PlayMaker Help & Tips > PlayMaker Help

[SOLVED] Compass

(1/1)

santelia:
I have to display the direction of the camera using a simple compass parented to the camera itself in one corner of the screen. Which action would you suggest to use to get the camera direction? And which one to direct the compass needle?

kiriri:
my personal favorite would be the position of the one minus the position of the other and then smooth look at direction. Then something like Inverse transform direction and then set vector xyz to constrain it to a local 2 axis (send one axis to 0) .
Can be done a lot easier though :D But that's the general drift.

Sorry, I read it again, just  get the world rotation of the camera and set it as local rotation on the needle, set vector xyz to y = 0 to make it spin on 2 axis only. All of these every frame.

santelia:
Since the child object of the camera needed to much tuning to be anchored where I wanted it to be, I switched to a GUI element. So, as kirikiri suggested, got the world rotation of the camera on axis Y. But instead of using it for vectors of a 3d object, I used its value with set rotation along Y axis of a compass gui texure inside the tool bar of the game.

Navigation

[0] Message Index

Go to full version