# ignoreBody query flag for IRaycastQuery

**URL:** <https://forum.babylonjs.com/t/ignorebody-query-flag-for-iraycastquery/61276>\
**Category:** Questions\
**Created:** [November 4, 2025, 5:14am UTC](https://forum.babylonjs.com/t/ignorebody-query-flag-for-iraycastquery/61276 "2025-11-04T05:14:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lwp-joel](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/lwp-joel/32/48432_2.png) [@lwp-joel](https://forum.babylonjs.com/u/lwp-joel)\
**Post date:** [November 4, 2025, 5:14am UTC](https://forum.babylonjs.com/t/ignorebody-query-flag-for-iraycastquery/61276/1 "2025-11-04T05:14:58Z")

</div>

Would it be possible to add the ignoreBody flag present in IPhysicsShapeCastQuery to IRaycastQuery?

My use case is to filter out the player’s body when raycasting from behind the player.

This change in havokPlugin.ts works for me:

```typescript
    public raycast(from: Vector3, to: Vector3, result: PhysicsRaycastResult, query?: IRaycastQuery): void {
        const queryMembership = query?.membership ?? ~0;
        const queryCollideWith = query?.collideWith ?? ~0;
        const shouldHitTriggers = query?.shouldHitTriggers ?? false;

        result.reset(from, to);

        //const bodyToIgnore = [BigInt(0)];
        const bodyToIgnore = query.ignoreBody ? [BigInt(query.ignoreBody._pluginData.hpBodyId[0])] : [BigInt(0)]; // copied from shapeCast

```

Of course, IRaycastQuery would need to be updated as well.

Thank you!

Edit: PR created: [Add ignoreBody filter for IRaycastQuery by lwp-joel · Pull Request #17390 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/17390)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 4, 2025, 4:58pm UTC](https://forum.babylonjs.com/t/ignorebody-query-flag-for-iraycastquery/61276/2 "2025-11-04T16:58:43Z")

</div>

cc @Cedric
