- Home /
collisions will sometimes be detected and sometimes will not
I have tried changing the rigidbody collision detection to continuous, and changing the Fixed Timestep under project settings to a smaller number. These both helped, but I am still encountering collision detection issues.
What type of collision detection issues are you facing? Could you be a little more specific?
I am detecting when bullets hit a person/wall/celling/etc... sometimes it will get detected and do what it is meant to do and sometimes it just passes through the object and nothing is detected
Bullets are sometimes too fast for colliders to detect....that's why using Raycasts can be a good solution
Answer by Astrydax · Jul 07, 2021 at 07:06 AM
This Is most likely an issue with the object moving to fast to be detected. I like to think of frames as pages in a flip book.
In a flip book, to make something appear to move faster, you draw it at a further distance on the next page (frame). If you have a bullet travelling really fast in a flip book, say 5 inches per page, anything sitting at 2.5 inch intervals will never come in contact with the bullet art unless you slow the rate of change per page.
This of course doesn't just apply to bullets, a skinny player moving too fast will be able to run through walls sometimes.
This is kinda how collision detection works with rendered frames. For this reason, there are 3 types of "shooting" commonly done for games, True projectile which is entirely physics based, Raycast which is like most sniper rifles where its instant, and then Hit scan, which is a projectile that shoots out rays as it travels. I believe overwatch is a game that employs all 3 methods depending on which character you're playing, your best bet is to look up the pros and cons of those different methods and choose which best suits your use case.