- Home /
CharacterMotor Gravity Set
I've been trying to change the Character gravity on mouseclick from a JavaScript attached to the character. It's working fine to change it from default to low, but nothing works to bring it back to normal.
[ON MOUSE CLICK]
{
if (chMotor.movement.gravity == CharacterGravityDefault);
{
chMotor.movement.gravity = CharacterGravityLow;
}
else (chMotor.movement.gravity == CharacterGravityLow);
{
chMotor.movement.gravity = CharacterGravityDefault;
}
}
If I comment out everything from else onward it's fine and there's no errors, but with this it coughs up an error (expecting : found = on the second line), though it's working fine with this layout for all the other systems (character speed, time, etc)
CharacterGravityDefault and Low are both floats defined at the top of the script, and seeing as it works well going from default to low I assume the first half is working fine.
Your answer
Follow this Question
Related Questions
Character motor movement and jump 1 Answer
Making a character move automatically in one direction. 2 Answers
Adding Swimming and diving to character motor? 2 Answers
character movement and animation 1 Answer
Player slides down slope. 0 Answers