playMaker

Author Topic: Gamepad/controller right stick look around?  (Read 634 times)

Cram

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Gamepad/controller right stick look around?
« on: October 29, 2018, 12:58:10 AM »
So, I've got input from the right stick on my controller connected through Bluetooth on my phone, but using the "mouse look" action doesn't really do anything.

The left stick works for movement using the "Horizontal" and "Vertical" axes, but I can't nail down what I should do for the right stick.
I've tried putting the camera in another object and rotating that object around the player using the input from the right stick, but it seems to rotate on the z axis, messing everything up. Weird.

The "mouse look" action rotates the camera perfectly. The way I need it. But it won't work on android.

tl;dr: I'm trying to use "mouse look", or something similar?, with my gamepad/controller on my Android phone, to rotate around the player for a third person perspective game. Akin to something like Max Payne/Fortnite.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4288
    • View Profile
    • jinxtergames
Re: Gamepad/controller right stick look around?
« Reply #1 on: October 29, 2018, 11:16:04 AM »
Hi.
You can try having a parent and place in the camera.

Then make an state like the image below to do the rotation :



On the multiplier you can adjust the amount you want it to turn.
Also if you want the other direction you can add or remove the -

In the Input manager you can play around with the 'Gravity' and 'Sensitivity' to adjust how fast it turns.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14198
  • Official Playmaker Support
    • View Profile
Re: Gamepad/controller right stick look around?
« Reply #2 on: November 01, 2018, 02:37:02 AM »
Hi,

 Djaydino is right, you'll need to build the feature from scratch, because on touch screens, there is no such things as a mouse, so there is now cursor to follow around.

I would however split the camera rig, your camera ( rotating around the horyzon axis) should be parented to an empty gameobject ( rotating around the up axis), itself parented to another empty gameobject. That way you have proper control over each rotation, and they won't get mixed up.


Bye,

 Jean

Thore

  • Sr. Member
  • ****
  • Posts: 253
    • View Profile
Re: Gamepad/controller right stick look around?
« Reply #3 on: November 01, 2018, 06:33:21 AM »
Hi.
You can try having a parent and place in the camera.

Then make an state like the image below to do the rotation :

[.img]https://i.imgur.com/mBfZsyZl.png[/img]

On the multiplier you can adjust the amount you want it to turn.
Also if you want the other direction you can add or remove the -

In the Input manager you can play around with the 'Gravity' and 'Sensitivity' to adjust how fast it turns.

Interesting that you split up into two set actions, is there a specific reason for this, or is this more convenience/symmetrical/consistent with the get axis action?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4288
    • View Profile
    • jinxtergames
Re: Gamepad/controller right stick look around?
« Reply #4 on: November 02, 2018, 01:35:24 PM »
Hi.
@Thore :

it is more easy to set the direction you wish to move,
Also if you want to manipulate the values (for example the make it move more smooth) for each axis