So basically I want that my platform need to leap when I passed key so I make object give behaviour of platformer and also give physics engine 2 .0 with it then I when I put platforms on the scene but the problem come with that my platformer is keep moving forward and when I passed key it as many times the movement become more faster so how can fix this thing
Posting a screen shot of your events would help.
Off the top of my head, I would guess you need to add “Trigger Once” to your Conditions. That way it won’t keep repeating and will stop doubling up every time you hit the key.
I’ve never used the physics engine, but if velocity is anything like force, you’ll need to stop the velocity. Is there a way to do something like: When P key is released, set the linear velocity to 0?
Or, you could use a timer to only have the velocity last for a specific amount of time.
It’s work but again it moving while I hold the key so what I need to do
Stop holding the key? You could also try the timer method I mentioned.
At the beginning of the scene:
- Pause a timer
When the key is pressed (trigger once):
- unpause the timer
- set velocity to 50
When the timer reaches however long you want the player to move:
- pause the timer
- reset the timer
- set velocity to zero.
Well it’s not work any other method