Direction of the collision between rectangles #1983
-
Hi everyone hope you're having a fun time with raylib as i am! I'm quite the beginner and don't know if the solution is too obvious and I'm just missing it |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Once you test for collision, just check a.x < b.x where character a's x position would be more left than character b. Super easy in 2D. If you said 3D, you'd have to think of a 3'rd axis. That is my brute force way which always works essentially. recap;
If you need to do collision detection for different places, you would have to have multiple hit points on your character and detect which one it was. I wouldn't even use triangle, but a radius. or a box |
Beta Was this translation helpful? Give feedback.
Once you test for collision, just check a.x < b.x where character a's x position would be more left than character b. Super easy in 2D. If you said 3D, you'd have to think of a 3'rd axis. That is my brute force way which always works essentially.
recap;
If you need to do collision detection for different places, you would have to have multiple hit points on your character and detect which one it was. I wouldn't even use triangle, but a radius. or a box