- Home /
Maybe easy to do, but: How?
Hi
I got 2 scripts to move my 3rd-person character in the way I aimed for:
One for horizontal movement with WASD keys, and one script to rotate the character around his Y-axis by moving the mouse left/right.
Now I try to find a way to bend the character's upper body,
so he can look to the ground or sky.
My Question:
How to rotate his upper body around his X-axis
by moving the mouse forwards/backwards?
I'm not clear which starting point could be the right or best one to achieve it,
maybe someone could show the direction I should take?
All tips are appreciated
You can do this with the 2D animation tools, specifically by setting up bones and things called Limb Solvers.
Brackeys has a video on them:
https://www.youtube.com/watch?v=eXIuizGzY2A
Use I$$anonymous$$ to set the lookrotation of the torso bone and add a clamp factor to prevent turning too much, also use the camera's forward direction to define lookrotation, assu$$anonymous$$g you're looking is directly tied to camera movement.
pretty sure for basic concept of this take a peak how Unity's Default assets for the char controller and for version compatible with your Unity Version. Newer version use the Packag manager in the windows menu or let the store download the one for your version if older. By my understanding of this question it does exactly what your looking to do right outta the box.. examples included. You may need to write your own base off of their code to do what you want, but its a base item with no licensing stuff included you can edit it at will change names if you like w.e its considered a prefab of sorts for beginners.
Answer by DatYak · Feb 21, 2019 at 04:26 PM
I think what you are looking for is IK, If you are using a humanoid model/rig is supported, but needs to be setup in code. If you are not using humanoid, then god luck :) (I tried to more animal like IK a while ago and it id not go well) If all you need is up and down rotation, you could make an avatar mask
Both of these could be the solution to moving JUST the upper torso.
Hi DatYak
Yes, my aim is just to move
the upper torso as it is illustrated
in the picture above,
and the movement should be
only mouse induced and no animation.
I will try it out as you suggested,
I think also that using avatar mask
could be the solution.
Thanks for your reply
Answer by Bunny83 · Feb 23, 2019 at 05:20 PM
You should look up Unity's AnimationLayers. Though we have no idea what your "character" actually is. So if it's a rigged model, a single 2d sprite, made up of several 2d sprite parts, ...
Hi Bunny83
$$anonymous$$y player character is a rigged humanoid 3d model.
Hope it doesn't takes too long
to solve that issue,
so that I can continue
to work on my game.
Your answer
Follow this Question
Related Questions
Turning character with transform.Rotate 0 Answers
Rotating a camera that has MouseLook.cs attached 0 Answers
Setting Up Vector and Still Rotating the Character 1 Answer
rotate around character 1 Answer
rotate around character 2 Answers