playMaker

Author Topic: Player is falling  (Read 2320 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • View Profile
    • Homepage
Player is falling
« on: September 21, 2013, 11:35:10 PM »
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! :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

escpodgames

  • Hero Member
  • *****
  • Posts: 686
    • View Profile
    • Assets
Re: Player is falling
« Reply #1 on: September 21, 2013, 11:53:45 PM »
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.

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • View Profile
    • Homepage
Re: Player is falling
« Reply #2 on: September 22, 2013, 12: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 :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

escpodgames

  • Hero Member
  • *****
  • Posts: 686
    • View Profile
    • Assets
Re: Player is falling
« Reply #3 on: September 22, 2013, 12:13:25 AM »
Doh, forgot about jumping :D

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • View Profile
    • Homepage
Re: Player is falling
« Reply #4 on: September 22, 2013, 12:39:21 AM »
Someone should make a new action that check if the player is falling. It's easer. :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15210
  • Official Playmaker Support
    • View Profile
Re: Player is falling
« Reply #5 on: September 22, 2013, 10:53:54 PM »
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

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • View Profile
    • Homepage
Re: Player is falling
« Reply #6 on: September 23, 2013, 02: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 :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15210
  • Official Playmaker Support
    • View Profile
Re: Player is falling
« Reply #7 on: September 24, 2013, 03:23:37 AM »
Hi,

 Someone made that custom action:

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

 bye,

 Jean