My ged examples never seem to work for you, so I'll explain it. Seeing as you did not describe the method for onscreen buttons you are using right now, I don't know what method would work best. Essentially it should work just like normal jumping code, but it seemed you never could get that working. The only difference is the jump event would be a mouse button down event...
You will need a variable to hold jump. Then on mouse button down of the jump key, put code like this.
JumpButton -> Mouse Button Down -> Script Editor
- Code: Select all
if(jump==1)
{
playerActor.yvelocity=-15;
jump=0;
}
The setting of jump still works through collision with the ground, meaning still the player actor's event. If you still want a ged of this, then ask, though this is pretty regular code, only twist is the setting of another actors yvelocity.