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!
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
5 People are following this question.
restrict mouselook X movement script does not work
rotation based on mouse position
Get angle from mouse direction?
Rotate around, but track the mouse
How to disable my mouse to turn right