Getting a model to look at you

static2601

L2: Junior Member
Nov 4, 2010
79
4
I was wondering how a would get a model or something to look at you or rotate on the z axis and follow you as you move around. It would only follow people within a set distance. I have a lot of experience in hammer (3+ years) but I can't think of a way to do this. I would think id have to parent the model to a func rotate or soemthing and have it follow a target thats within a trigger area. Thanks
 
T

The Asylum

So is this going to be used for something like a health pickup or something similar? Is this a custom model? You may be better off using an env_sprite depending on what you have in mind
 

static2601

L2: Junior Member
Nov 4, 2010
79
4
it was gonna be a custom model, I tried a few things, Might be easier for me to just make a plugin that gets client position and changes the model angle to the clients position. Id rather have it in the map though.
 

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
I could think of a super sloppy way to do it involving a bunch of triggers cut out of a circular brush that trigger each rotation manually and it wouldn't be that accurate, but there is probably a better way than that.
 

Beetle

L9: Fashionable Member
Aug 17, 2008
627
178
You're probably not going to get the result you want with Hammer alone. Hammer has enough problems with rotating things to begin with (in TF2)
 

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
I've used momentary_rot_button using this method for the radar dish in Stoneyridge and the spinning train in Trainsawlaser. I imagine it could be repurposed for something similar, it's just a matter of getting the proper angle of rotation set up to some sort of input.
 

static2601

L2: Junior Member
Nov 4, 2010
79
4
I could think of a super sloppy way to do it involving a bunch of triggers cut out of a circular brush that trigger each rotation manually and it wouldn't be that accurate, but there is probably a better way than that.

LOL Yeah I could do that and thought about it before, Id make a cylinder shaped trigger an cut it into a hundred pie slices and when each slice is touched, will change the move distance of the prop_door_rotating. That would be a little sloppy but would probably work but run my ent data through the roof, and its already pretty high. Ill just stick with a plugin for now.
 

static2601

L2: Junior Member
Nov 4, 2010
79
4
I've used momentary_rot_button using this method for the radar dish in Stoneyridge and the spinning train in Trainsawlaser. I imagine it could be repurposed for something similar, it's just a matter of getting the proper angle of rotation set up to some sort of input.

I could try that too, ill take a look at it later, thanks.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
Getting a model to look at you
Step 1: Be handsome
Step 2: Don't be ugly

On a more serious note the door that Element mentions wouldn't really be relevant to this because that was just a linear relationship made possible with point_proximitysensor.

There isn't really any simple and smooth way to do what you are asking, but whatever method you end up picking you would want a momentary_rot_button instead of a door, because it supports a variable position input rather than messing around with changing move distances.
 

static2601

L2: Junior Member
Nov 4, 2010
79
4
Wow very nice! i love how the hallway broke apart and flipped over to become the path.(reminded me of Farcry 3 a little) Didnt know something like that was possible in Source. Must of used alot of entities. I would love to make something like this. I seen the door, Im guessing a trigger_look with velocity flagged.
The last part where I had to jump to the door to the bedroom, I was a scout and had to double jump, how would you get there if your not a scout?
 

static2601

L2: Junior Member
Nov 4, 2010
79
4
Step 1: Be handsome
Step 2: Don't be ugly

On a more serious note the door that Element mentions wouldn't really be relevant to this because that was just a linear relationship made possible with point_proximitysensor.

There isn't really any simple and smooth way to do what you are asking, but whatever method you end up picking you would want a momentary_rot_button instead of a door, because it supports a variable position input rather than messing around with changing move distances.

I was trying trigger_look and logic_playerproxy, didnt work. Ill try the point_proximity_sensor.
 
Last edited:

static2601

L2: Junior Member
Nov 4, 2010
79
4
well i think i need to get the client angles and set the angles of the model to them. I know how to do it in soucepawn but not hammer. I forget how exactly, though Ive done it once. Right now im trying to use point_proximity_sensor to detect my angles, targetname !activator(dont think it works like this) and trying to move the momentary_rot to a position of what im not sure yet.
Ill post something if I ever figure it out.
 

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,669
1. I don't think point_proximitysensor will work... UNLESS Element elaborates on his statement. I've done pseudo-trig with entities before... what were you thinking of?

2. !activator only works as the target of an output (...maybe the parameter too? I can't really think of when that would be used, nor do I remember trying).

3. mom_rot_bot position is a 0-1 range, 0 being "closed" and 1 being 100% of the move distance being traveled.

4. about my map, the last platform slowly floats over there, a lot of people were too impatient to notice this, so you aren't alone. and no, it wasn't a trigger_look, like I said it was a p_ps. You can read more about it if you want.
 
Last edited:

Freyja

aa
Jul 31, 2009
2,994
5,813
How did you do the sentry-defense that locks onto players in traingrid, Booj? Is that built in to the rigging of the sentry?