Game
Chaotic Clone
4 years ago

I have just fixed an annoying collision bug and would like to point out how to fix it.


When designing a tile based game in Unity you may have noticed a weird bug; objects get stuck on the ground/wall's collision. This is something that may confuse a lot of developers. What I believe is happening is that the object manages to penetrate the tilemap's collision. This is a very big issue that is luckily very simple to solve. One of the most common solutions is to create a physics material with friction with set to 0 and to apply this to the tilemap collider. This honestly works but it doesn't completely remove the solution. Sure, objects get stuck less often but that is definitely not enough. So what else can we do? Now the solution isn't immediately obvious but it is simple; we just need to change our colliders. I imagine that most people will use box colliders but think about what happens if there is a tiny elevation difference between to tiles. It is obviously going to get stuck. So what colliders would solve this? Circle and capsule colliders. Since the edges are rounded the object will now get pushed upwards. Now we have significantly improved game play just by changing the colliders.



1 comment

Loading...

Next up

Not as exciting as I originally intended but it works.

Really didn't know how to create this sprite so I'd appreciate any feedback.

Hmm, I wonder what happened here.

New Update: Version 0.0.3 is an incredibly small update. It contains graphics for the moving platform, crate and teleporter objects. I know it is very small and underwhelming but I decided to release the graphics on their own as it is an important update.

Sorry for the lack of news. I got a little burnt out and ended up taking a break. Here's a new sprite though.

Just in case you wanted to see this (Sorry for the low framerate)

Once again its nothing exciting but it works.

Some concept art that no one wanted to see. And yes I know I have no artistic ability.

Yeah that makes total sense

Smile! Here, take some happy pills! ✨💊 #Blender #3DModelling #3DArt Buy me a Ko-fi: https://ko-fi.com/barbarafb_