my camera is on Z axis… all of my objects are on the x-y pane.
so, i have a game object with an arrow sprite pointing up. I want to have that arrow head pointing towards the hit point.
I have a function that is called upon Raycasthit is known:
Quaternion toHitRotation = Quanternion.FromToRotation(hit.point, Vector3.forward) * this.transform.rotation;
this.transform.rotation = toHItRotation;
however, it doesn’t work. I check the gameobject, instead of having x & y being zero, now, there are values in x & y, and things get weird. I tried to “normalized” by adding:
this.transform.rotation = this.transform.rotation * Quanternion.Euler(0,0,90);
and still doesn’t work.
what did I do wrong?