Anyoine knows how to disable the “jump” of FPC from the scrip? Thanks
A simple way to do this is to comment out the line that reads
motor.inputJump = Input.GetButton("Jump");
…in the FPSInputController.js script (it should be line 32 if you are using an unmodified version of the script).
Sorry, I was not clear. I would like to disable this feature during game.
What andeeee means is to add // ← that to the beginning of the line he posted above. So, replace
motor.inputJump = Input.GetButton("Jump");
to
//motor.inputJump = Input.GetButton("Jump");
For example, when the player collides with an object that I use as a trigger, I want that he cann’t jump and then when colliding with another object, which can jump again.
var canJump : boolean = true;
...
if(canJump)
{
motor.inputJump = Input.GetButton("Jump");
}
...
function OnTriggerEnter(other:collider)
{
[INDENT]
if(other.gameObject.tag=="noJumping")
{
[INDENT]
canJump=false;
[/INDENT]
}
[/INDENT]
}
function OnTriggerExit(other:collider)
{
[INDENT]
if(other.gameObject.tag=="noJumping")
{
[INDENT]
canJump=true;
[/INDENT]
}
[/INDENT]
}
^That’s the general idea
Thank you, kieblera5