I'm creating an android game therefore requires no mouse or keyboard, just touch.
I want a button to be on the screen which when touched causes the player to jump.
I created the button which is a 'sprite' and used the touch system which is as follows;
On touched object (button) - action = simulate platform - pressing jump
This doesn't seem to work????
Try every tick, check if the button is being touched then call the same action.
How should i code that? I'm slightly confused
Develop games in your browser. Powerful, performant & highly capable.
1. create an event every tick
2. add a condition "Object is in touch"
3. add the event Platform:SimulateControl(Jumping)
The capx below shows a jump simulated via platform behavior and a touch or click of a button.
Thanks so much guys. I Figured out what the problem was. The platform that the player was standing on was a moving platform (i created a scrolling background with 'solid' behaviour to give off the impression that the player was running. For some reason this stopped the player from jumping (not a clue why).
So i solved it by keeping everything the same except i created another solid object with '0' opacity making it invisible. I placed the object just above the moving platform so that the player was ever so slightly above the moving platform stopping him from interacting with it. The player now Jumps thanks so much for your help as well!!!