- Home /
Other
UI Compas tracking wrong axis
I am trying to use a UI image to point towards my game objective in a topdown 3d style setup, the issue I am having is my compass is only half working and is tracking my object on the x and y axis instead of the x and z.
Any ideas or hints where I am going wrong?
[code=CSharp] Vector3 compasImage = target.transform.position; transform.LookAt(transform.position + transform.forward, compasImage - transform.position); [/code]
Answer by logicandchaos · Jan 09, 2020 at 01:07 PM
Try changing transform.forward to transform.right
Answer by pantang · Jan 09, 2020 at 01:28 PM
Thank you for the reply I have tried that but when I use .right my image becomes very jittery and although it does track the axis when it does it transforms the UI image on the wrong axis .
What I think I am trying to do is track the object x&z and transform only the images z rotation
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to drag objects from UI into scen 3 Answers
Overlay 2 scenes 1 Answer
UI dropdown index problem 1 Answer