- Home /
Player Torso Rotation to mouselook. (Diagram included)
Hey guys, I have a question for you.
I'm working a FPS where your player model is visible. What I am trying to achieve is having the player model's torso (arms, upper body and head etc) rotate vertically (not horizontally as the player model is rotated with the mouselook) to look at where the mouselook is aiming. Now, I'm sure this can be achieved with a Raycast on where the camera is, but I have a bigger problem then that.
The spine on the character distorts the character model when rotated. It's pivot has an offset which results in the torso being sent forward. Take a look at the diagram at the bottom of this question.
Picture number 1 shows the character as it is. It works normally until I try to rotate the spine that has the upper torso linked to it. This is where picture 2 comes in. You can see that it's moving outward. Picture three shows the end result.
From what I can see, it looks like the position need's to be changed as the spine is rotated, so the spine position can stay where it is. Picture 4/5 shows me moving the spine backward, and then upward. The character looks normal after doing that.
So this is where my question kicks in!
How would I be able to adjust the position of the spine in relation to where the rotation is of the spine? For example when in picture 3 the spine is rotated upward, then position should also move like in picture 6.
Any insight into this matter would be very appreciated!
Your answer
Follow this Question
Related Questions
restrict mouselook X movement script does not work 4 Answers
How to rotate an object around a fixed point so it follows the mouse cursor? 1 Answer
How to make an object rotate on the y axis towards the mouse? 3 Answers
Rotate object following mouse movement. Object jumps/ flips 1 Answer
Rotation of the mouse activates a boxcollider2d in javascript. 1 Answer