- Home /
Move gameobjects in the direction the player is facing
Hi, I'm developping a game like mount & blade, so the problem is that i want dispose soldiers in formation (e.g. square, line ecc) and for now i've found a simple function that calculate all soldiers position in formation. I would like to make the soldiers in formation move in the direction the player is facing, but I do not know how to do that. Any Ideas??
Answer by logicandchaos · Mar 26 at 04:04 PM
Use the transform.forward vector in your move code. transform.forward*speed
ok, once i get the block of soldiers in formation, if I would like to move all of them in front of the player, I Just have to do: SingleSoldierPos*transorm.position.forward*speed, is it right?
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Nav Mesh Agent para perseguir a un clon 1 Answer
How to make enemy AI with NavMesh 2 Answers
My ai is getting stuck when there is a lot of them 0 Answers
NavMeshAgent object jumps 0 Answers