- Home /
How to do a plane follower?
I Need a plane that follows the player, only the x,z position, as I have put a camera from the sky to indicate where the player if you enable this camera, as I can do and try transform.Translate (player.transform. position) but doesn't work , and many more that I have seen but I like a little guidance
Thanks
It's not very clear what the plane is and how you want it to act, if our answers doesn't turn out right for you please explain further.
Answer by Muzz5 · Jun 14, 2011 at 06:33 PM
Why not use Transform.LookAt and then Transform.translate? Easiest way to do AI imho.
Answer by save · Jun 14, 2011 at 06:38 PM
How about making the plane a child of the player in the Hierarchy? If you want smooth movement you can use something like this on your following object (not having it as a child):
var player : Transform;
var speed : int = 2;
var objHeight : int = 50;
function Update() {
transform.position.x = Mathf.Lerp(transform.position.x, player.transform.position.x, Time.deltaTime*speed);
transform.position.z = Mathf.Lerp(transform.position.z, player.transform.position.z, Time.deltaTime*speed);
transform.position.y = objHeight;
}
(not tested)
Answer by flyingpigs3 · Jun 14, 2011 at 06:49 PM
i dont know the answer but i would like to preview your game or at least know its name so i can view it. Thank you for your time.
Please don't post comments as questions; ins$$anonymous$$d, use the comment space below the original post.
flyingpigs3
http://www.juliancruz.net/runaway2/
this is what I have to demo, but I have that I have done in 4 days, please do not be hard to judge, he moves with a, s, d, w, the map is seen with the m key, shoot right click, and left the m16 does have zoom, throw grenades with G,
Have fun.
Your answer
Follow this Question
Related Questions
Camera rotation around player while following. 6 Answers
Keeping camera stay put in the y position 2 Answers
camera doesnt follow player after I added networkIdentiy and networkTransform to the player 0 Answers
how make this script follow a target. 1 Answer
Camera shake while following Player 1 Answer