One Way Collision

RondoRocketRondoRocket Member Posts: 411
edited November -1 in Working with GS (Mac)
Does anyone know of a way (or trick) to create one way collision so an actor can pass through a non-movable actor but not go back?

Comments

  • juzcookjuzcook Member Posts: 259
    I'll give an example when jumping that worked for me.

    You need to constrain the Player's Y position to an attribute.

    --
    When Player collides with Platform
    and Player.Y > Platform.Y + (Height of Platform)

    Then Bounce with object
    --

    That way the player only collides when it's above the platform, but can still pass through it :)
  • RHRH Member Posts: 1,079
    Or you could say that when self.motion.Y > 0 collide. This means that only when the actor is falling will it bounce off the object.
  • RondoRocketRondoRocket Member Posts: 411
    Cool, I'll give these ideas a shot. Thanks a lot for your help, guys!
  • RondoRocketRondoRocket Member Posts: 411
    Still no luck. I tried the examples but I'm trying to make a platformer where the actor can jump up to another platform directly from below. Seems like I need to have some level of restitution on for this to work but I just want my actor to land and not bounce. Any thoughts?

    Thanks for any help.
  • RHRH Member Posts: 1,079
    In my post I meant when self.motion.Y is < 0. My bad! That should work.
Sign In or Register to comment.