- Home /
Best Way to turn part of a 3D model in game
While developing a current project, I've realized I might have an issue later in the project.
This game is utilizing 3D models of mechs, which has brought up an interesting question for me. While the player is controlling the mech (3rd person), I want the user to be able to move the mech quickly in any direction at will, which will rotate the legs towards wherever the player is pointing. However, I also want the torso of the mech to be permanently aimed towards the enemy, which brings me to my question.
Is there a simple way in Unity to have the mech's legs move independently from the main torso of the mech, or should I export them as 2 objects that I can then just parent and control independently of each other in engine?
Answer by dan_wipf · Jan 15, 2019 at 04:29 PM
well i’d go for the second option, but you can export the legs and torso as one, just be sure to make one parrent object in your modeler and the put in there the legs and torso..
you might want to have a look then for your torso, that you use transform.LookAt() for keep facing the enemy
Vector3 targetPostition = new Vector3(enemy.position.x, transform.position.y, enemy.position.z);
transform.LookAt(targetPostition);
Thank you for the reply! I guess this really just helps with getting a second opinion since this is my first time doing a project of this scale. Your idea about parenting within the modeler is something I'll definitely look into as well!
Your answer
Follow this Question
Related Questions
Tell Object not to move with its parent 3 Answers
Reset player movement axes after camera rotation 1 Answer
Move child objects in the opposite direction of parent object 0 Answers
Why My Gun Rotate When i keep on pressing my mouse button and Move the Mouse 0 Answers
Rotation problems when I child a sword to players hand! (pictures within to clarify) 1 Answer