How to change default movement speed

LiquidLink

New member
Sorry for the dumb question but trying to figure out how to change the default movement speed has been driving me nuts. I don't want to do it through the state system I literally just want to hard code in a different value for the base movement speed of my game. Any help would be appreciated. Thanks.
 
@LiquidLink You can simply increase speed of character by increase values of 'Motor Acceleration' & 'Motor Airborne Acceleration'

You can find these under UltimateCharacterLocomotion component of character.
Your Character> UltimateCharacterLocomotion> Motor
 
@LiquidLink You can simply increase speed of character by increase values of 'Motor Acceleration' & 'Motor Airborne Acceleration'

You can find these under UltimateCharacterLocomotion component of character.
Your Character> UltimateCharacterLocomotion> Motor

Thanks for that, not sure how I missed that haha must have been tired.
 
I know this is old... but can someone please share how to reference the Motor Acceleration or TimeScale properties in the UltimateCharacterLocomotion component? I'm able to reference the Abilities, but nothing inside the Motor category.
 
Well... I thought I had, since it compiled... but it doesn't actually change the values of Motor Acceleration in the inspector.
Any help would be much appreciated.

private UltimateCharacterLocomotion uCL;

private void Start() {
uCL = GetComponent<UltimateCharacterLocomotion>();
}

private void Update() {
if (Input.GetKeyDown(KeyCode.T)) {
uCL.MotorAcceleration.Set(.36f,0,.36f);
}
else {
uCL.MotorAcceleration.Set(.18f,0,.18f);
}
}
 
This works:

C#:
// player is ref to character gameobject

if (Input.GetKeyDown(KeyCode.T))
        {
            player.GetComponent<UltimateCharacterLocomotion>().MotorAcceleration = new Vector3(1, 0, 1);
        }
 
a couple of things:

You probably want to be polling Input.GetKey() (not GetKeyDown) -- GetKeyDown only returns true on the first frame that the key press is detected.

Instead of else (which will reset the value every frame) you probably instead want to poll for keyUp and just change it one time, after the player has let up...

Code:
if (Input.GetKey(KeyCode.T))
        {
            uCL.MotorAcceleration = new Vector3(1, 0, 1);
        }
       
 else if(Input.GetKeyUp(KeyCode.T))
        {
            uCL.MotorAcceleration = new Vector3(.1f, 0, .1f);
        }

(tested, works)
 
Top