- Home /
2D Platformer Raycasting vs. Rigidbody collisions
I've been reading up on different 2D Platformer guides and one thing I haven't understood is why a lot of them recommend Raycasting.
Here are the two scenarios in my head:
Scenario 1: You use raycasting essentially to detect collisions and you handle each one separately.
Scenario 2: You use rigidbodies and colliders (2d) to detect collisions and you handle each one separately.
Most tutorials tend to stick with raycasting because that's how old platformers were designed. It seems like a lot more work though.
Keep in mind I'm assuming that you only use rigidbodies for the collision detection and nothing else. This means that you still manually control velocity etc. without worrying about forces or gravity or friction or anything else.
Is there something intrinsic about rigidbodies that I'm missing that would lead developers from defaulting to handwritten raycasting logic? I totally get having total control and the value there, but collision detection seems so trivial that I can't see why I wouldn't have the framework handle just that aspect for me?
Your answer
![](https://koobas.hobune.stream/wayback/20220612094322im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Layers of collision, or multiple collisions 1 Answer
Collision detection not working as intended 1 Answer
Scale object, collision not working 2 Answers
Change gravity on button 1 Answer