playMaker

Author Topic: Use of CAMERA ORBIT [SOLVED]  (Read 3751 times)

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Use of CAMERA ORBIT [SOLVED]
« on: May 05, 2013, 04:47:31 PM »
I am using the GET MOUSE coordinates in conjunction with CAMERA ORBIT action.
It's working fine but the problem is: it never stops moving.

Because the CAMERA ORBIT action is always adding the mouse coordinates, the camera is always moving to reach the mouse pointer .

Now, I thought that if I can put the mouse coordinates in variables that last until the next frame, I could check if the mouse has been moved, and if not, reset it to 0,0.

But, first of all I don't know how to store variables so they will be available on the next frame, and this would be good to know. Tried to look around but found nothing.

Second, maybe there is a reset cursor coordinates that puts the mouse back into position?

And one last thing: why there are no commands to set the mouse pointer coordinates??? Or... well I couldn't find it!
« Last Edit: May 06, 2013, 04:54:08 PM by megmaltese »

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Reset the mouse coordinates???
« Reply #1 on: May 06, 2013, 02:11:28 PM »
Nobody knows this? It should be trivial  :'(

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Reset the mouse coordinates???
« Reply #2 on: May 06, 2013, 02:25:21 PM »
I dont think that approach works. What happens when the mouse reaches the edge of the screen? Your control system stops working properly.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Reset the mouse coordinates???
« Reply #3 on: May 06, 2013, 02:41:34 PM »
At the moment, I read the mouse coords normalized and add .5 to each.
This is working perfectly.

Now, if only I could reset the mouse coordinates to 0,0 when the user stops moving, that would be everything I need, right?
And of course I don't mean only reset MY coordinates, I mean the mouse coordinates.
I know this is possible because there is another action that locks the cursor at the middle of the screen :D

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Reset the mouse coordinates???
« Reply #4 on: May 06, 2013, 03:17:04 PM »
well you could use Float Changed on your normalized, stored mouse coordinates and Set Mouse Cursor (lock checked) to do this in a couple of states but I do not think it would be stable.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Reset the mouse coordinates???
« Reply #5 on: May 06, 2013, 04:05:28 PM »
The float changed is interesting and useful, but in this case I'd occur in the problem you mentioned before: when the user reaches the screen limit, there would not be a way to go further.
The only solution is to reset the mouse coordinates.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Reset the mouse coordinates???
« Reply #6 on: May 06, 2013, 04:14:15 PM »
Right, use the float changed false result to run the Get Mouse Cursor action and lock the mouse back to the center of the screen then exit the state.

It's going to do this every frame though, so if your mouse coordinates dont move every frame then it gets reset to the center of the screen. Could be an issue for slow movement unless you looped through a brief timer and state for a check every (wait) 0.x seconds.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

PolyMad

  • Hero Member
  • *****
  • Posts: 545
Re: Reset the mouse coordinates???
« Reply #7 on: May 06, 2013, 04:51:48 PM »
Hey, thank you for help but I think I have found the best solution.
It relies on the GET AXIS action, which gives the mouse straight difference of movement from the previous frame.
Just get MOUSE X and MOUSE Y using the GET AXIS action, and use them  to feed  CAMERA ORBIT  ;D

How much I hate all this stuff that has to be learned... wish I knew all already, so much time lost.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Reset the mouse coordinates???
« Reply #8 on: May 06, 2013, 04:53:47 PM »
Glad you got it sorted.

I had a hard time figuring out a lot of this when I did the helicopter controller. It was a good learning experience.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D