Why does Collider2D.Cast exist, but not Collider.Cast? - Unity Engine - Unity Discussions
How do I use ColliderCast properly? - Unity Engine - Unity Discussions
Collider or Cast?
You forgot a fairly important detail.... 2D or 3D?
Anyway, I would use box colliders and utilize the ContactPoint property for hit direction detection. Box colliders are easy to scale etc to fit your dynamic models. No need to make it more complicated than it has to be.
Sphere/box/etc-casts are good for temporary, fixed, rare-isch events. Such as checking if something is in the vicinity when pressing a button(like for example, a hand, and you press "grab", do a cast and check if anything grabbable is in vicinity).
More on reddit.comCast to detect a collider future position
Videos
I am making a game that's in a way sort of like Mario where you cannot damage enemy's with a sword or any of that but only by stomping on them. As well as the power ups that can shoot projectiles and make the PLAYER model different.
I want to know what is a better solution for collision for this type of game, currently I am using Box Casts, Overlap Circles, etc. I find that this solution works but if I change the character model it goes and becomes a NIGHTMARE. I then opted for a better solution which was Colliders (I'm not sure if it is the best solution) and they make it way easier to modify.
Just a bit of background to what I used the Casts for were things such as, creating a Cast for the Lucky Blocks, creating a Cast to check if the feet of the PLAYER touched the enemy's head, creating a Cast to collect Coins, and more.
I am making this thread so that I can understand how to use Casts, because of now I am either using colliders for triggers or just casts which I usually use Casts. Please just let me know how Casts should be used and how Colliders should be use. As well as for my type of Mario like Game which would be better to use in the Long Run.
Thank you in Advanced 😃
Casting a Collider2d perpendicularly downward into horizontal surface should result in RaycastHit2D.point being RaycastHit2D.distance from the lowest point of the collider, but it doesn't (even accounting for the contact offset). Changing the cast distance is resulting in different hit distances, when it shouldn't. Collider2d.Cast just doesn't seem to return results anywhere near accurate enough to be of any use. Am I doing something wrong?