- Home /
Question by
uplusion23 · Aug 27, 2014 at 05:35 AM ·
charactery axisriggedarm
Move Character Limb based on Main Camera's Y Axis
I have a rigged model, and I'm attempting to make my rigged characters arm move up or down based on the camera's Y angle. When attempting to do so, the arm breaks and twists, some scary stuff. My code for it is pretty simple but stumps me. #pragma strict private var cameraY: float; private var rarmY: float;
var rarm: GameObject;
var cam: GameObject;
function Update () {
cameraY = cam.transform.eulerAngles.y;
rarmY = rarm.transform.eulerAngles.y;
rarm.transform.eulerAngles.y = cameraY;
}
Any idea why this isn't working? I have the forearm as the rarm var, and the camera as the cam var.
Comment
Your answer
Follow this Question
Related Questions
why when i use animator component cant script on bone? 0 Answers
Rotating arm with Animation Event 1 Answer
Animate a humanoid rigged character 0 Answers
Changing rotation by code with animator 0 Answers
Character rotation to a specific degree 2 Answers