Strange Collision Issue

FallacyStudiosFallacyStudios Member Posts: 970
edited September 2012 in Working with GS (Mac)
So the game I'm working on is a platformer. I'm getting an odd collision issue just by walking along the ground. He will just be walking across the floor and stop. He can't move and many times I either have to turn around and back or jump. Sometimes 1 or both of those is needed to get past the collision.

Currently the floor and the character are both Collidable to eachother. I've looked in all the floor actors (because there are a few of them lined up to form the ground) and all of them show as being the same size and are placed on the same Y so getting a collision from the corner of the next floor ahead doesn't make sense atleast from what I am seeing. Any suggestions?

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    What behavior are you using to move the actor? move, self.linear motion?

    Double check the Y positions on the images, all it takes is 1 pixel, even if the Y positions are the same, sometimes there can be abnormal placing. And just for a test, go ahead and lower the next floor actor where the actor is getting stuck to see if it keeps moving on.

    And you could always use a constrain attribute on the actor when it is moving to force it to keep going. But when it gets to a split, if one actor is a little higher, it will jump a little, like on a ramp.
  • FallacyStudiosFallacyStudios Member Posts: 970
    Yea I'm using linear motion because Move just was responding correctly when using jumps and other actions.

    Yea I've gone through and checked them all and they all show the same height and y placement. Odd thing is the collision doesn't happen in the exact same locations every time.

    Hmm how would you place that in?
  • ahodge0821ahodge0821 Member Posts: 10
    edited September 2012
    The floor actor should be “unmovable” and make sure the physics are all zero for everything in the floor. Why does the floor actor collide with the hero actor? What exactly are you trying to do by making them collide with one another?
  • FallacyStudiosFallacyStudios Member Posts: 970
    The floor is unmovable and those attributes are all set to 0. He collides with the floor so he doesn't go through it with gravity.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Even though the platforms are on the same Y it may still snag the hero so what I always do if possible is make the hero actor collision a circle not rectangle.

    Hope this helps.

    Darren.
  • FallacyStudiosFallacyStudios Member Posts: 970
    @UtopianGames Hmm that is a good one and might just work fine with my set up. I'll give it a shot thanks.
  • FallacyStudiosFallacyStudios Member Posts: 970
    @UtopianGames Thanks that seems to work. I haven't seen the collision issue anymore. One weird thing is happening and I'm wondering if you have seen it. Even though my hero is set to Collide with the floor he seems to sag into the floor some since I changed him to Circle. Like his feet are about 10px into the floor even though technically he should still be on top of it cause of the collide. Even when I jump he still goes down that far into the floor. Not a huge deal, but the enemy actors with the same set up (being a Circle, having gravity, and collide with floor) are still on the top of the floor. Would just be nice if it was consistent is all.
Sign In or Register to comment.