playMaker

Author Topic: Can I make my gamepad right sticker to act like a mouse? (I use InController)  (Read 939 times)

Silicon Power

  • Junior Playmaker
  • **
  • Posts: 92
    • View Profile
Hey guys, I need to make my gamepad right sticker to act like a mouse movements, is that possible? also I'm using InController asset too.
« Last Edit: November 10, 2016, 11:21:37 PM by Silicon Power »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Hi,

you can't fake mouse movement, in the sense that if you read the mouse position, that's it, there is no other way.

 
the best way is to compose mouse movemement and custom inputs, then if the user has a mouse it works, if the user has a joysticks it works.

this is how you do it as well if you want to support mouse and touch, the best way is to accept both inputs.

Bye,

 Jean

Silicon Power

  • Junior Playmaker
  • **
  • Posts: 92
    • View Profile
Hi,

you can't fake mouse movement, in the sense that if you read the mouse position, that's it, there is no other way.

 
the best way is to compose mouse movemement and custom inputs, then if the user has a mouse it works, if the user has a joysticks it works.

this is how you do it as well if you want to support mouse and touch, the best way is to accept both inputs.

Bye,

 Jean

Thanks for help, but how can I read mouse position? and then change it position with right sticker.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Hi,

 yes, save the mouse position into a vector variable and then add the sticker position to it.

 BUT you won't be moving the cursor... you understand that right?

for this ( not tested myself), you'll need an asset like:

https://www.assetstore.unity3d.com/en/#!/content/17177

and you'll need to create custom actions for it. Maybe the author would be willing to provide support. Else let me know, I'll put it on my todo :)

Bye,

 Jean