How to make an object constantly looked in the direction of another object.
5 replies, posted
How to make an object constantly looked in the direction of another object?
You mean the object has something like a face, and you want it to aim that face always in the direction of a other object?
If you are talking about player - Entity/SetEyeTarget, if not:
(FirstEntity:GetPos() - SecondEntity:GetPos()):Angle()
Entity/SetAngles (Player/SetEyeAngles)
I want to make something like a compass out of a bottle in HUD
use what @LoweChaser said and create an entity for a N reference so that the compass "prop / object" whatever always looks there ?
For the bottle surface.DrawTexturedRectRotated
you'd use the player eye angle yaw offset to define the texture rotation Entity/EyeAngles
I assume you're new so it'll take you a bit of time to figure out the idea behind the math, but I'm sure
you'll be fine!
Sorry, you need to Log In to post a reply to this thread.