Better collision detection

I'm following along with a platform tutorial but I'm using my own graphics. The graphics I'm using have some extra space around them and that makes it look ackward when they are running off a platform, as they don't fall even when completely off... not until their bounding box is completely off.

Is there a way to do better collision detection? At least one the main character?

Thanks!

Comments

  • TosanuTosanu Member, PRO Posts: 388

    The best bet is to not have the character themselves be what collides. You create invisible actors to the exact size you want the collision to be, and then Constrain the player character to this position, or place them behind the platforms, whatever needs to be adjusted. Note that if you are placing this collision box on the player character, the box will need to have all the movement rules attached to them.

  • ookami007ookami007 Member Posts: 581

    So... create a bounding box, alpha to 0, then place all the rules on it and have the player's x,y constrained to the bounding box x,y?

  • TosanuTosanu Member, PRO Posts: 388

    Essentially, yes. That would be the basic method. You would just need to have shared rules to activate animations if you have any.

  • JJBloomJJBloom Member Posts: 7

    Hi, I'm having a very similar problem.

    Got 4 walls and an actor. Trying to make the actor float in any direction and then bounce off the walls.

    At the moment, it starts floating randomly but when it hits a wall, it starts to shake and sort of stays close to the wall.

    Scene gravity is 0
    Friction on wall and actor is 0
    Density is 1 for both
    Bounce is 1 for both

    Any ideas?

  • RPRP Member Posts: 1,990

    It's a hit box. Constrain the hit box to the actor. The actor can be large as hell, but the actual detectable hit area, is well....contrained to very basic geomertry, but if you shrink it, to a specific location/s on your actor...there are variables.

  • JJBloomJJBloom Member Posts: 7

    Awesome. How do I do that and why will it make a difference?

  • JJBloomJJBloom Member Posts: 7

    I didn't make a hit box. I just made the regular actor bounce on collision.

Sign In or Register to comment.