Jump through platform - Actor is colliding with side of platform

toastyteetoastytee Member Posts: 53
edited April 2014 in Working with GS (PC)

Hi guys,

I'm working on a platformer style game and I'm having trouble with the player jumping through the platform. For reference I'm following T-shirt booths tutorial:

I can get the player to jump through the platform and land on the top. The problem I'm having is that if the player moves off the platform and quickly moves back towards it, it will continue to collide with the side of the platform. This is still happening even with the rules that say:

when PlayerX > SelfPositionX-(SelfSizeWidth)/2)-(PlayerWidth/2)

when PlayerX < SelfPositionX+(SelfSizeWidth)/2)+(PlayerWidth/2)

Collide with player

Comments

  • toastyteetoastytee Member Posts: 53

    Ok guys, its been two years. Still have no solution to this problem?

  • toastyteetoastytee Member Posts: 53

    Sorry for the video quality but here's what I'm talking about:

    The logic I have for the platform looks like this:
    If PlayerPositionY >= SelfPosition.y+(Self.size.height/2)+16
    then collide with player.

    What is happening is if you drop off the side of the platform and immediately move back toward it, the player continues to collide with the side of the platform, despite having the rule above.

  • WhitePantherWhitePanther Member Posts: 72

    you dont want the white actor to go through the brown actor?

  • toastyteetoastytee Member Posts: 53

    I want the player to collide with the platform only when hes on top of it, not when hes on the side of it.

  • WhitePantherWhitePanther Member Posts: 72
    edited August 2016

    Do it like this, 2 separate actors
    much easier, less commands

  • toastyteetoastytee Member Posts: 53

    still can't figure it out but i did find a workaround.

    If: PlayerPositionY >= SelfPosition.y+(Self.size.height/2)+16, collide with player
    otherwise: Spawn actor (platform), destroy self

    would still love to know if theres a way to do it without needing to spawn/destroy platforms

  • IceboxIcebox Member Posts: 1,485

    It might be a box2d issue , i think its just how the collision manager works in gs i would love to know as well i tried couple of ways but couldnt get it to work

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited August 2016

    Have you tried checking the "better collisions" box on the physics tab of the actor? Not sure it will help, but it's worth a try.

    Mental Donkey Games
    Website - Facebook - Twitter

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    @toastytee said:
    still can't figure it out but i did find a workaround.

    If: PlayerPositionY >= SelfPosition.y+(Self.size.height/2)+16, collide with player
    otherwise: Spawn actor (platform), destroy self

    would still love to know if theres a way to do it without needing to spawn/destroy platforms

    Try checking linear velocity Y . . .

    For example if linear velocity Y is > 0
    --some rule goes here
    Otherwise
    --collide with platform

    So the player is able to jump up through the platform (a positive Y velocity), whereas on the way back down (a negative Y velocity) or at rest (0 Y velocity) it will collide with the platform.

  • frdfrd Member Posts: 191

    Rule in ground actor-

    If self position y >= player position y - (work out the correct number ie 50)
    Do nothing
    OTHERWISE
    collide with player

  • frdfrd Member Posts: 191

    Here's a quick example.

Sign In or Register to comment.