Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Rabagast on September 22, 2013, 02:35:10 AM

Title: Player is falling
Post by: Rabagast on September 22, 2013, 02:35:10 AM
Is it possible to check if the player is falling? Controller Is Grounded doesn't work I think, since it's only checking if the player is grounded or not grounded.
I want something happened to the layer only when it's falling!

Thanks! :)
Title: Re: Player is falling
Post by: escpodgames on September 22, 2013, 02:53:45 AM
If you're not grounded .. what are you?

Ignoring that, you can take the position and check it against the position of the next frame, if it is moving down (assuming normal gravity) the player is falling.
Title: Re: Player is falling
Post by: Rabagast on September 22, 2013, 03:10:57 AM
Of course the player is grounded or not grounded, but OnGrounded check if the player is on the ground or not on the ground. Also when the player is jumping, but anyway....I will try that example :)
Title: Re: Player is falling
Post by: escpodgames on September 22, 2013, 03:13:25 AM
Doh, forgot about jumping :D
Title: Re: Player is falling
Post by: Rabagast on September 22, 2013, 03:39:21 AM
Someone should make a new action that check if the player is falling. It's easer. :)
Title: Re: Player is falling
Post by: jeanfabre on September 23, 2013, 01:53:54 AM
Hi,

You can watch the velocity of you player and deduce logical meaning out of it. If the direction of the velocity is align with the y world but negative, then it's falling. But you have to be  careful here, it could be that you are jumping and on your way down.

 What kind of game set up you have? I would consider having a trigger underneath the ground and then ou know the player is falling of the platform. But you may have a different kind of game. Can you explain more about it?



Bye,

 Jean
Title: Re: Player is falling
Post by: Rabagast on September 23, 2013, 05:37:19 PM
Hi!
I'm making a singlescreen platform game, retro style.
I have just some problems with the falling and landing animation.
I'm very satisfied with the controller so far, but when the player is landing, the landing animation is still playing maybe 0.3 seconds or something. And I was just thinking if I check when the player is finished falling, then the walking animation is playing again. Or I can use it for other things, like play a sound when i'm falling or die if i'm falling from a very high place.

I was also checking the scripting reference. There I found "IsPlaying" for animation. I don't find that in Playmaker. It could be very useful.

Thanks for helping me! :)
I hope someday I also will be able to help other people :)
Title: Re: Player is falling
Post by: jeanfabre on September 24, 2013, 06:23:37 AM
Hi,

 Someone made that custom action:

 http://hutonggames.com/playmakerforum/index.php?topic=3021.msg13764#msg13764

 bye,

 Jean