Question by
lickthebottomofmytoe · Mar 11, 2021 at 01:56 AM ·
camerascripting problemcharacter
How to rotate a bone along with the camera
I've been struggling trying to get my character's arms to rotate relative to the camera to make my character aim where the camera is pointing at. I've been using the following code in a script below attached to my camera object.
Vector3 Rightarm = rightArm.transform.rotation.eulerAngles;
Vector3 Leftarm = leftArm.transform.rotation.eulerAngles;
Rightarm.x -= mouseY;
Leftarm.x -= mouseY;
Rightarm.z = 0;
Leftarm.z = 0;
rightArm.rotation = Quaternion.Euler(Rightarm);
leftArm.rotation = Quaternion.Euler(Leftarm);
Comment
Your answer
Follow this Question
Related Questions
align player to object location in C#? 0 Answers
Script has been added to my object but it cannot be found using GetComponent() 1 Answer
Object appears to glitch as it moves whenever the camera follows it. 0 Answers
Framing multiple objects from a list along y axis only? 0 Answers
Terrain Problem! Character begins to wobble extremely! 2 Answers