Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Grave_sts on January 12, 2012, 12:43:18 AM

Title: Get mouse position and rotate help??? [SOLVED]
Post by: Grave_sts on January 12, 2012, 12:43:18 AM
Hey all~

I was wondering how one would approach this in playmaker ;)

I want to have the function that when the player moves the mouse to the sides of the screen, for instance top, the camera gets rotated on the y axis.

i.e the camera should only rotate once the mouse itself reaches the edges of the screen

Thanks in advance
Title: Re: Get mouse position and rotate help???
Post by: jeanfabre on January 13, 2012, 03:05:14 AM
Hi,

 You simply need to compare the mouse position with the screen sizes and for example is within 10 pixels of the edges ( that is less then 10 if on the left side or within screen.width-10 for the right side), then you can trigger.

 You could also then use the distance from the edge to vary the speed of rotation.

 Mess with this, if you have problems implement this, let me know, I'll do a prefab for this, or maybe an action, seems quite useful to know the distance from the edges actually, I can see lots of usage for it.

 Bye,

 Jean
Title: Re: Get mouse position and rotate help???
Post by: Grave_sts on January 26, 2012, 01:34:34 AM
Hey~ Thanks for the reply ^^ In the end I approached it using triggers - but I am still keen to see how you would have approached it ^^