- Home /
Colliders for a tile based game
I'm trying to build a game that uses tiles for level design. I'm having issues figuring out how to generate colliders so the player does not appear to fall off the side of the platform (I want to restrict movement to the platform, much like Megaman Battle Network). I have my level constructed in a scene but going back and adding box colliders to the sides of the platform is inefficient.
Each tile has it's own box collider attached to it to act as a ground. I'm not sure why my Character Collider's isGrounded is always returning false.
I had the idea of using Raycast to see if the player is going to be stepping off the platform and if so to stop them from doing so. However, this is hacky and stops the player rather than letting them slide along the side of the platform.
Is there a way I can effectively solve this problem with either Vector algebra or some other collider solution?
Any feedback is greatly appreciated!
Answer by garner · Mar 31, 2012 at 01:18 PM
Why don't you spend time to put colliders enveloping a series of identical tiles instead of trying to build a complex collision system. It would be much faster if you use less colliders anyways.
Thanks for the feedback!
I actually ended up doing this. At first it was difficult to position the colliders exactly the way I wanted but I found that since my tiles are 1 unit wide I could just make 1 unit wide box colliders and then use the snap to axis feature to position them exactly where they needed to be.
Your answer
Follow this Question
Related Questions
Hey guys, can you help me out with my colliders. 0 Answers
OnTriggerEnter() and OnTriggerExit() called multiple times despite checks. 3 Answers
Can a CharacterController ignore one or more Colliders? 2 Answers
Character Controller won't collide with anything 1 Answer
Character Controller squeezed between colliders freezes Unity 0 Answers