- Home /
Enable/Disable CharMotor jumping
Hi,
is there anyone who can help me?
Answer by robertbu · Jul 26, 2014 at 06:49 PM
The CharacterMotor does not jump on its own. That is, the CharacterMotor is part of a hierarchy of scripts with the CharacterController at the bottom, and some other script like FPS Input Controller or something you wrote on top. It will be the top script that tells the CharacterMotor to jump. They did it this way so that the CharacterMotor could be used for AI as well as characters the user controls. So to enable/disable jumping in the character motor, just don't tell it to jump, or you can set CharacterMotor.jumping.enabled.
From the script that is driving the Character$$anonymous$$otor, you will have a reference variable. Something like char$$anonymous$$otor. Using that reference variable you can do:
char$$anonymous$$otor.jumping.enabled = false;
Your answer
![](https://koobas.hobune.stream/wayback/20220613155037im_/https://answers.unity.com/themes/thub/images/avi.jpg)