playMaker

Author Topic: Get mouse position and rotate help??? [SOLVED]  (Read 2506 times)

Grave_sts

  • Playmaker Newbie
  • *
  • Posts: 24
Get mouse position and rotate help??? [SOLVED]
« 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
« Last Edit: February 29, 2012, 01:43:22 PM by Alex Chouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get mouse position and rotate help???
« Reply #1 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

Grave_sts

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Get mouse position and rotate help???
« Reply #2 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 ^^