Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Susher on April 02, 2013, 04:10:33 AM
-
Hi folks, I´m trying to make a 2D game object jump by tapping the screen.
So far I have created an "touch event" witch triggers "add force", Y coordinate.
The game object jumps all right, but it hangs in the air! lol, how can I stop the "add force"?
-
Hi,
You likely need to exit the state where you apply the force, either by using a transition, or have another state implement a global transition.
Are you sure this is a free falling gameObject? it could be that it doesn't take in account the gravity, double check the physics component attached to this gameObject.
bye,
Jean
-
Hi Jean, this is how my setup looks like (attached screenshots).
The game object is jumping up from the ground (rage spline) when adding force,
and gravity is enabled yes.
Do I need to add another state after the apply force state?
If so, what state :) ? Do I need to copy the previous state and set it up with negative Y force? (to cancel out the force)? and then transition to the idle state again?
-
First of all I must warn you: weight units in Unity are not kilos, they are TONS.
This said, first of all you should probably give an IMPULSE of force with adequate power (much more) and NOT every frame, so it will only be given to the object in one frame.
If instead you want to make it with the EVERY FRAME option, then add an action WAIT after that action, with the time you want the power added, add another state like END or something, and in the WAIT action set FINISHED and go to the END state.
-
O- shit.. :P, now I understand what the problem has been!
80 ton dog, lol.. a bit over fed!.
Also, the impulse setting worked, one frame!
Thank you so much megmaltese! Made my week!
-
Glad I can help, for once, instead than just bothering asking for help all the time :D