Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: santelia on June 03, 2012, 04:11:46 AM

Title: [SOLVED] Compass
Post by: santelia on June 03, 2012, 04:11:46 AM
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?
Title: Re: Compass
Post by: kiriri on June 03, 2012, 01:25:53 PM
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.
Title: Re: Compass
Post by: santelia on June 06, 2012, 04:03:56 PM
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.