playMaker

Author Topic: Looking around with Xbox right stick?  (Read 3142 times)

daniellogin

  • Full Member
  • ***
  • Posts: 215
Looking around with Xbox right stick?
« on: August 12, 2018, 03:34:44 PM »
Ok so there is a super easy mouse look action, but I'm having trouble finding how to set up looking the camera around with the right stick of an Xbox gamepad.

Where can I find a proper tutorial, or can someone detail the steps needed here?

Also; My plan is to have 2 local players. I don't know if this will affect the steps needed or not.

Doh

  • Full Member
  • ***
  • Posts: 124
Re: Looking around with Xbox right stick?
« Reply #1 on: August 12, 2018, 08:07:50 PM »
You would likely have to set your controllers up using the "input manager" and various actions from the input actions included with Playmaker.

However due to different controller brands/models outputting very different axis and button signals I'd suggest using a plugin like Rewired (https://assetstore.unity.com/packages/tools/utilities/rewired-21676) which will automatically detect the type of controller plugged in and the corresponding inputs, Rewired seems like a good pick (I don't personally have this plugin, though wish I did) due to the fact that it comes with Playmaker actions.

Best of luck!

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: Looking around with Xbox right stick?
« Reply #2 on: August 13, 2018, 06:46:54 AM »
This is the only thing I still cant do.
I have rewired and i did map everything but not the mouse look.

Another thing I couldnt do is to stop mouse look action (for example, a pause game menu that stops the game) and then come back to mouse look on the exact point before stopping it. Camera goes crazy. Did several topics in playmaker help, no answers.

Doh

  • Full Member
  • ***
  • Posts: 124
Re: Looking around with Xbox right stick?
« Reply #3 on: August 13, 2018, 07:50:14 AM »
I haven't tried to do what you have though would it not be possible to set it up as follows, call pause - record controller/mouse input variables - initiate pause - call unpause - initiate unpause - apply recorded controller/mouse input variables?

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: Looking around with Xbox right stick?
« Reply #4 on: August 13, 2018, 09:40:53 AM »
You would likely have to set your controllers up using the "input manager" and various actions from the input actions included with Playmaker.

However due to different controller brands/models outputting very different axis and button signals I'd suggest using a plugin like Rewired (https://assetstore.unity.com/packages/tools/utilities/rewired-21676) which will automatically detect the type of controller plugged in and the corresponding inputs, Rewired seems like a good pick (I don't personally have this plugin, though wish I did) due to the fact that it comes with Playmaker actions.

Best of luck!

I have a copy of InControl that I got in a store giveaway. But I think I'm having trouble with what to do with the mapping. I made a simple test where there is a cube and another cube as a child which has a camera. I use one FSM to Get Axis Vector relative to the camera, then (in the same state) use the Rotate to spin the cube around. The child cube with the camera does a Get Axis Vector relative to itself and Rotate to itself.

But it's being weird. It at first seems to work fine where I can look up and down as expected, but after looking around a bit like this then the controls invert. Looking around a bit more it inverts again. I don't think I'm having and issue with the parent cube spinning though.

Am I using the wrong actions? Am I missing something extra?

Doh

  • Full Member
  • ***
  • Posts: 124
Re: Looking around with Xbox right stick?
« Reply #5 on: August 13, 2018, 03:39:19 PM »
Just a guess here but if it's working temporarily then inverting it sounds like you may have a variable that's accumulating over time rather than resetting at each interval.

I'd recommend observing what each variable is doing before, during and after the point it inverts. It should hopefully become obvious once you do this.

If this doesn't shed any light on the issue please provide some images to show how the states are set up. Best of luck!

miguelfanclub

  • Full Member
  • ***
  • Posts: 165
Re: Looking around with Xbox right stick?
« Reply #6 on: August 17, 2018, 08:59:21 AM »
I did it and works. Here is what I did. Just change the rewired actions for whatever you use to get the axis from mouse or pad. This use an acumulative value over clamped floats (to limit to whatever the view). Speed variable is used to accelerate the mouse look or slower it down.

1


2