How do i make an attribute turn true only when an actor touches the top

I am making a game where I have an actor called "player". I have my game set up so that when the player collides with a second actor called "Platform" it changes the attribute "player grounded" to true (otherwise false). This only allows the player to jump when the player is touching the platform. The problem I am having is that the player can jump even when it is only touching the side of the platform. I need the player only to jump when it is touching the top of the platform!
Any help is greatly appreciated!
Thanks!

Best Answer

  • kinzuakinzua Posts: 554
    Accepted Answer
    Accommodate the platform height to min. so that you have next to none side edges.
    The other way to tackle this situation would be to add a rule which says player.pos.y is >= platform.posY+((platform.height/2)+(player.height/2)).
    Check it out and see if it works!
Sign In or Register to comment.