Such feature isn't available out of the box, but there is an open source script (available on all versions) that you can modify to have certain inputs be "forced" into the system.
First, switch your Input Manager under Global Editor -> Input Options to "Custom Class".
Once selected, go to the Hierarchy and add a component called "GUIControlsInterface" to UFE Manager. Hit play and you will see gui buttons representing controls for player 1. Those buttons can be used as "touch controls" using simple UI elements.
Once you done that, open "GUIControlsInterface.cs" and make a function for the Update event so it can force the hAxis to 1 or -1 depending on the direction the character is facing.
This is a relatively hard thing to do and it does require some C# knowledge.
----------
Alternatively, if you own the Source version, you can add the following function to the file "UFEController.cs":
public virtual void PressButton(ButtonPress button, InputType inputType = InputType.Button, int axisValue = 0)
{
foreach (InputReferences inputReference in this.inputReferences)
{
if (!this.isCPU && inputReference.inputType == inputType && inputReference.engineRelatedButton == button)
{
if (inputType == InputType.Button)
this.inputs[inputReference] = new InputEvents(true);
else
this.inputs[inputReference] = new InputEvents(axisValue);
}
}
}
Once you've done this, simply use the call below to force an input:
UFE.fluxCapacitor.PlayerManager.player1.inputController.PressButton(ButtonPress.Button1);
And if you want specific direction orders, use something like:
// P1
UFE.fluxCapacitor.PlayerManager.player1.inputController.PressButton(ButtonPress.Forward,InputType.Horizontal,-UFE.GetControlsScript(1).mirror);
// P2
UFE.fluxCapacitor.PlayerManager.player2.inputController.PressButton(ButtonPress.Forward,InputType.Horizontal,-UFE.GetControlsScript(2).mirror);
Like UFE? Please rate and review us on the
Asset Store!
Questions about the Forum? Check out our
Karma FAQ.
Don't forget to check our
discord channel.