Player velocity.y changes when running horizontally over a composite collider 2D?
So I have a tile map, with tiles. I added a tile Collider 2D and a Composite Collider 2D to the tile map. Everything was working perfectly, until i noticed i couldn't jump. My jump code is based on the player velocity.y == 0, and running horizontally on the composite collider changes the player velocity.y, even though running on a box collider would not. I am very confused. Any help would be greatly appreciated!
In the picture the player is only running horizontally, no code is changing the velocity.y
Answer by oscurekid · Feb 08 at 11:39 AM
Turns out that the composite collider applies a little up force to make objects compensate the gaps (Which are unperceptible) between tiles, just add a little velocity threshold to your player's script like this and it will be just fine
Your answer
Follow this Question
Related Questions
Limit of a move for position 1 Answer
How to move camera using 2dboxcollider trigger as activation to move 0 Answers
TileMap2D awfull performance on Chunkloading 0 Answers
How To Smoothly Climb Over Tiles? 1 Answer
Collider problems? 2 Answers