- Home /
Quad Object needs to look at character rotating one Axis
Hi everyone, new to the comunity, so here I go.
We have a problem on our game about Quad looking at the camera just rotating one axis of the object. As you can see in the picture you will understand:
http://puu.sh/gxh78/d7137252b4.jpg
What we need is to make the Quad look at the character screen, just rotating on the Axis X of the object, not the world. We tryed to figure how to do it but we don't have any other option for doing that.
The code we use right now is:
var newRotation = Quaternion.LookRotation(transform.position - target.position, Vector3.forward);
newRotation.z = 0.0;
newRotation.y = 0.0;
transform.rotation = Quaternion.Slerp(transform.rotation, newRotation, Time.deltaTime * 8);
We would like to appreciate any kind of help or recomendation about how to solve it, even if we have to change the script.
Thanks for your time and take care.
Your answer
Follow this Question
Related Questions
How do you force a player to look at something? 4 Answers
Best way to place a name tag over a player? 1 Answer
SphereCast help 1 Answer
2.5D Sprite always face at camera 0 Answers
Rotation offset help! 0 Answers