- Home /
Raycast reporting a collision in the wrong place?
I'm having a strange problem with my raycasts.
Recently I've rigged an enemy character with some capsule colliders on various body parts to have body-part specific damage. The character also has a character controller on the root but I have it set to ignore raycasts. I currently use raycasts to grab whatever information I need on what the raycast hit.
For some reason, the raycasts are reporting a collision on a completely different position from the collider it supposedly hits. It would say it's hitting the chest collider but the hit position is somewhere a bit above the character. The editor shows that the collider is where its supposed to be and the enemy character is the only one in the scene with a body rig of colliders. They seem to translate and orient themselves correctly with the character animation as well.
I've circled the hit position which is reporting its hitting the right upper-arm collider and I've drawn an arrow to where the collider actually is.
Did you solve the problem? I have the same problem and can't figure out how to solve it.