Open GavynBryan opened 1 year ago
This confuses me since to my knowledge a raycast (or even a spherecast) is supposed to ignore the collider it starts in. And the origin is always going to be the camera which is a child to the player object.
I'll get to this once I'm done with Base AI behaviour, but here's my plan so I don't forget:
My worst fear is that somehow the player's position at a given frame is lagging behind their velocity or something similar.
This is also somewhat challenging to reproduce since the rays fire at somewhat random angles and I can't get this to occur with every shot.
This is an issue with the CharacterController's Move() function being called in Update() instead of FixedUpdate(). Unity's colliders only update in Physics updates so it makes sense that sudden changes in velocity like jumping would cause issues with raycast origins not being accurate.
I believe this will resolve itself in #31
When jumping, moving forward and looking down at the same time, the player's weapon behavior will clip into its own collider. Find out why this is happening and resolve.