How to changer the movement speed by how to move the joypad

shimj1

New member
Is there a way to slow down the movement speed of the joypad at the gradient distance?

The most ideal is to start running when you move Joypad a lot like PUBG Mobile, and to make it behave like walking slowly when you move it a little.

Also, I would like to know if possible, but I would like to know if there is an easy way to change the layout of canvas on the built mobile app.
 
Last edited:
There isn't a way using just the built-in abilities system etc. to activate an ability based on input amount/strength, but I believe for joystick input you can just check the character's InputVector (i.e. UltimateCharacterLocomotion.InputVector) and manually start/stop an ability based on that. So you could create your own custom Generic ability (or even just a subclass of SpeedChange), within which you check InputVector every frame and start/stop the ability if it goes above a certain value.

For the mobile canvas - are you using one of the input assets described on this page? Are you familiar with using Unity's UI components at all? If not I'd recommend checking out some basic Unity tutorials on them, because it should be easy enough to re-organise any UI elements as you need.
 
Should I write the following in UltimateCharacterLocomotion?
--------------------------------------------------
public void InputVectorChecker ()
{

}
--------------------------------------------------

How should I write a program that detects the size of the InputVector?
I looked at various forums but didn't understand.
 
Something like this:

C#:
public class CustomSpeedChange : SpeedChange
{
    public override void Update() {
        base.Update();
        
        if (!IsActive && m_CharacterLocomotion.InputVector.magnitude >= 0.5f) {
            StartAbility();
        }
        if (IsActive && m_CharacterLocomotion.InputVector.magnitude < 0.5f) {
            StopAbility();
        }
    }
}

An example of a simple custom SpeedChange ability that would start/stop based on the InputVector's magnitude. This is just a basic idea and hasn't been tested.
 
Top