Kart speed won't change

I’m trying to change the kart speed in Kurotori’s udon karts prefab and no changes that i make to the script seem to be updating at all when i try the kart in build and test. I’m making sure its compiling and everything but the kart always goes the same speed. Can anyone help with this?

1 Like

Hey not sure if you still need this but in case someone else encounters the same issue. At the bottom of the code for ‘UdonCarSystem’ there is a section that normalizes (caps) the velocity.

here it is:

    public void AdjustSpeed()
    {
        if(Mathf.Abs(velocity * 3.6f) > MAX_SPEED)
        {
           
           rigidBody.velocity = (MAX_SPEED / 3.6f) * rigidBody.velocity.normalized;
        }
    }
}

What I did was just comment out this line “rigidBody.velocity = (MAX_SPEED / 3.6f) * rigidBody.velocity.normalized;” by putting // in front of it. It hasn’t had any adverse effects yet… but im assuming you can just tweak or adjust the numbers there if you still need to cap or normalize velocity… Still not sure why changing Max Speed doesn’t seem to effect this (at least from what my tests could tell)

Hope this helps someone