InControl Integration

bluebird

Member
Hi Justin,

As per our last discussion here: https://opsive.com/forum/index.php?threads/virtual-touchpad-isnt-working-correctly.1109/#post-5633

You suggested to use dedicated asset for touch controls. so I purchased InControl and I'm trying to integrate it.
But somehow it's not working. May be I missed something to setting up. I searched the forum but didn't find discussions/questions on this.

I imported InControl asset and it's integration and then followed these steps: https://opsive.com/support/documentation/ultimate-character-controller/integrations/incontrol/

This is InControlInput configuration on Nolan game object. I also set Binding type to 'Opsive.UltimateCharacterController.Integrations.InControl.SampleBindings' as specified in the instruction.

I set target platform as Android.

Check out attached screenshots and let me know if you require more information.

Thanks
 

Attachments

  • incontrol config1.PNG
    incontrol config1.PNG
    111.8 KB · Views: 41
  • incontrol config2.PNG
    incontrol config2.PNG
    72.6 KB · Views: 37
What part isn't working? The sample bindings were setup for a desktop so with touch you'll likely need to do some more configuration. Take a look at the InControl docs for steps on how to setup the bindings.
 
I switched target platform to standalone, but it doesn't make any difference.. still input isn't working.
Did you check screenshots I attached? Did I miss something to setting up?
 
It looks like you have the UnityInput component still added. You need to completely remove that component.
 
Hello everyone,

If anyone facing issues while integrating touch input using InControl, you need to modify SampleBindings.cs script

Here are the steps:
1) First go through all 6 steps here:
https://opsive.com/support/documentation/ultimate-character-controller/integrations/incontrol/

2) Create Manager for Touch inside Hierarchy
InControl > Touch > Manager

3) Add required UI controls such as joy stick/touch pad/ buttons etc

i) InControl > Touch > Stick Control
This will be responsible for moving character with joystick input

Select Target to 'Left Stick' under options

1344

To add bindings for stick control, need to bind LeftStick to left, right, up and down actions in SampleBindings.cs
// Create the character movement actions and bindings. var leftAction = CreatePlayerAction("Move Left"); var upAction = CreatePlayerAction("Move Up"); var rightAction = CreatePlayerAction("Move Right"); var downAction = CreatePlayerAction("Move Down"); upAction.AddDefaultBinding(Key.UpArrow); downAction.AddDefaultBinding(Key.DownArrow); leftAction.AddDefaultBinding(Key.LeftArrow); rightAction.AddDefaultBinding(Key.RightArrow); upAction.AddDefaultBinding(Key.W); downAction.AddDefaultBinding(Key.S); leftAction.AddDefaultBinding(Key.A); rightAction.AddDefaultBinding(Key.D); leftAction.AddDefaultBinding(InputControlType.LeftStickLeft); rightAction.AddDefaultBinding(InputControlType.LeftStickRight); upAction.AddDefaultBinding(InputControlType.LeftStickUp); downAction.AddDefaultBinding(InputControlType.LeftStickDown); leftAction.AddDefaultBinding(InputControlType.DPadLeft); rightAction.AddDefaultBinding(InputControlType.DPadRight); upAction.AddDefaultBinding(InputControlType.DPadUp); downAction.AddDefaultBinding(InputControlType.DPadDown); var horizontalAction = CreateOneAxisPlayerAction(leftAction, rightAction); var verticalAction = CreateOneAxisPlayerAction(downAction, upAction); m_BindingsMap.Add("Horizontal", horizontalAction); m_BindingsMap.Add("Vertical", verticalAction);
 
ii) InControl > Touch > Track Control
This will be responsible for camera look around

Select Target to 'Right Stick' under options

1345

To add bindings for track control, need to bind RightStick to mouse left, mouse right, mouse up and mouse down actions in SampleBindings.cs

// Create the camera movement actions and bindings. var mouseLeftAction = CreatePlayerAction("Mouse Left"); var mouseUpAction = CreatePlayerAction("Mouse Up"); var mouseRightAction = CreatePlayerAction("Mouse Right"); var mouseDownAction = CreatePlayerAction("Mouse Down"); mouseLeftAction.AddDefaultBinding(Mouse.NegativeX); mouseUpAction.AddDefaultBinding(Mouse.PositiveY); mouseRightAction.AddDefaultBinding(Mouse.PositiveX); mouseDownAction.AddDefaultBinding(Mouse.NegativeY); mouseLeftAction.AddDefaultBinding(InputControlType.RightStickLeft); mouseUpAction.AddDefaultBinding(InputControlType.RightStickDown); mouseRightAction.AddDefaultBinding(InputControlType.RightStickRight); mouseDownAction.AddDefaultBinding(InputControlType.RightStickUp); var mouseXAction = CreateOneAxisPlayerAction(mouseLeftAction, mouseRightAction); var mouseYAction = CreateOneAxisPlayerAction(mouseUpAction, mouseDownAction); m_BindingsMap.Add("Mouse X", mouseXAction); m_BindingsMap.Add("Mouse Y", mouseYAction);
 
iii) InControl > Touch > Button Control

Select Target to 'Action1' under options, however we can add multiple buttons and change it's target respectively. (like Action2, Action3, etc.)

1346

To add bindings for button control,
// Create the fire1 action and bindings. var fire1Action = CreatePlayerAction("Fire1"); fire1Action.AddDefaultBinding(InputControlType.Action1); fire1Action.AddDefaultBinding(Mouse.LeftButton); m_BindingsMap.Add(fire1Action.Name, fire1Action);
 
Top