Hello! I’m noticing there’s a discrepancy between the raycast hit point on a regular PhysX raycast and the ECS Raycast the farther away I am from origin. I’m not sure if this has to do with floating point precision, but there’s a noticeable difference around at least 50 units away from the origin. Also the offset error always has a bias towards the origin that’s stronger the farther away you get.
Blue dot is ~350 units away from origin and the accurate hit position.
All scaling is uniform and the rays are executed with the same references to ray origin and direction. I’ve tried different types of meshes to raycast against and got the same results.
Does the ECS Physics world just have less precision when it comes to Raycasts / floating point stuff? Am I missing something?
Unity Physics uses a Start position and an End position. Make sure you’re passing two positions, not a starting point and a direction.
Queries on matching collision bodies should have very similar results at this scale. Sharing a sample project showing this behavior would be useful if you want diagnosis.
Unity Physics uses a Start position and an End position. Make sure you’re passing two positions, not a starting point and a direction.
I’m assuming you can use a direction in this case by just putting direction * rayLength for the end position?
Queries on matching collision bodies should have very similar results at this scale. Sharing a sample project showing this behavior would be useful if you want diagnosis.
Thanks I’ll try a fresh project next and share it if this is unexpected.