playMaker

Author Topic: Getting Mouse X loop across the screen.  (Read 2237 times)

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Getting Mouse X loop across the screen.
« on: April 21, 2013, 07:10:40 AM »
How do you get movement of mouse X to constantly rotate something even if the cursor hits the side of the screen?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Getting Mouse X loop across the screen.
« Reply #1 on: April 21, 2013, 10:27:06 AM »
you could use a screen pick with normalized coordinates and multiply it for a value you can use for rotation. I did that for a helicopter controller after i added .5 to the normalized values so i could get positive and negatives from the center of the screen.

Make sense? You'll just constantly add that resulting value to the object and its always updated based on the position of the mouse.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

TIGGYsmalls

  • Junior Playmaker
  • **
  • Posts: 80
Re: Getting Mouse X loop across the screen.
« Reply #2 on: May 14, 2013, 12:41:58 PM »
Just come back to thins because I don't like the movement. I wan't to be able to keep swiping the mouse left and right.

is it possible in Playmaker?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Getting Mouse X loop across the screen.
« Reply #3 on: May 14, 2013, 12:50:16 PM »
Hi,

 Yes, perfectly possible and very easy actually.

 You need to use the "Get Axis" action and reference "Mouse X" which is a default input ( Check the input settings to see the whole list and how they are each set up).

 basically, you will get the delta movement, even when mouse seems clamped to the screen.

 Then, if you want to keep an absolute position value, you simply need to add this mouseX to the mouse position you picked when you started this behavior ( it may be when the game starts and you constantly keep track of the mouse Absolute position, which will be totally different from the actual mouse on screen obviously, but that's fine for your need I guess).

Bye,

 Jean