PhysicsRaycastResult.reset() does not reset .body property

Hi everyone,

Just an FYI, see here: https://playground.babylonjs.com/#E5URLZ#4

Logs “target1” 3 times; whereas it should only be logged once.

Fix by undefining body yourself. Come to think of it: checking for PhysicsRaycastResult.isHit should also work (shouldnt it?)

Regards
Joe

Hey, thanks for the report, I’ll fix that!

Yup, you can test for hasHit (I assume you’re talking about this), this one is being reset properly.

PR: [Physics] Reset body and body index on PhysicsRaycastResult by carolhmj · Pull Request #14022 · BabylonJS/Babylon.js (github.com)

2 Likes