Question by
Shanlu17 · Feb 24, 2017 at 12:38 PM ·
javascriptscripting problemjumpingforcejava
Increase jump speed colliding on a box ??
(I'm new). I need to jump high ( one shot) when i collide on a box. Someone can help me?
Comment
Best Answer
Answer by TheyLeftMe4Dead · Feb 24, 2017 at 08:05 PM
You should checkout the Unity documentation for some of the methods you can use. But for your question, your code should look like this:
class box : monodevelop
{
public int extraSpeed;
int playerJumpSpeed;
bool jumpedOnThis;
OnTriggerEnter()
{
if (jumpedOnthis == false)
{
playerJumpSpeed += extraSpeed;
jumpedOnThis = true;
}
}
}
Your answer
Follow this Question
Related Questions
Jump Force/Velocity is Wrong and Strange. Help 1 Answer
How to rotate camera view? 0 Answers
Trigger enabling component works in one statement but not another? 1 Answer
Why all instantiated objects get triggered when 1 is? 0 Answers
Unity 5 Sound repeating when detected by raycast JavaScript 2 Answers