- Home /
How to get enemy Rigid body to move?
I am making a pop up shooter game and was wondering how to have one of the enemies to slightly pop out from behind a tree for a short period of time before going back behind the tree. Any ideas what type of script to use ? I am abit inexperienced with unity so be warned.
Answer by thef1chesser · Oct 25, 2013 at 11:22 AM
well you take the enemy script (dunno if you have different ones or just one type, but for now i'll go for just this 1 enemy type)
in it you put a Stopwatch (which will work by adding "using System.Diagnostics;" at the top) for the timing.
then you use this.rigidbody.transform.position = Vector3.Lerp();
for more info: http://docs.unity3d.com/Documentation/ScriptReference/Vector3.Lerp.html
Your answer
Follow this Question
Related Questions
Animation not following character? 0 Answers
Collisions with an animated character 1 Answer
Stopping animation affecting physics 0 Answers
Problem with collision detection during animation 1 Answer
Animation causes rigidbody to move 0 Answers