- Home /
Question by
killa247 · May 17, 2017 at 06:08 AM ·
programminganimated
Bones Rotating wrong?
I need my bones to rotate the angle between point A and B. I've been trying transform.lookat and it always seems to make it go sideways. and ive tried quaternions but I must be doing something wrong.. please help!
direction = (B.transform.position - A.transform.position);
Quaternion rot = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(direction), 10 * Time.deltaTime);
transform.rotation = rot;
transform.eulerAngles = new Vector3(transform.eulerAngles.x, 90f, 0);
Comment
have you tried A.transform.position - B.transform.position