- Home /
2d animator mouse look clamped
Hi. I'm trying to make a mouse look up/down effect. In the gif it shows that it works, but when the mouse clicks at extreme up/down, the rotation is like clamped to around 45deg PLUS the whole animation looks distorted sideways.
The complete setup for the gif is so(although I tried many other variations):
Base layer for walk/idle etc. Mask on everything except Spine bone- Override ArmDirection layer for the rotation spine. Mask only on spine bone. override Action layer for attack. Mask on body & Clavicle onwards except spine bone - additive
The bone setup has a spine bone, that's just a bone before the clavicle, after the body bone. It's not rotated at all in any animation except the look up/down that's used in the ArmDir layer BlendTree.
If I were using 2D sprites, I would just rotate the spine bone to look at the mouse. But in this case perhaps it's not that simple because the body got Y and Z rotation as well, so even if the spine is rotated 90deg to look up/down, it might be distorted sideways.
So is this possible to do with BlendTree anim of look up/down(which uses local rotation of the spine bone), or should I override the spine bone's rotation using global rot by code? This should work(although I'm not sure how to achieve this yet), especially because the character is kinda Rayman style. But for learning purpose, will this also work for a normal skinned mesh character? (I'm guessing the spine if rotated in global space would look bent unnaturally..) Cheers
Your answer
![](https://koobas.hobune.stream/wayback/20220612121837im_/https://answers.unity.com/themes/thub/images/avi.jpg)