VisionOSHoverEffect: ignore select mesh children?

When using the VisionOSHoverEffect component, is there a way to make it ignore some mesh children (i.e. they do not highlight with the rest but is still visible), or is the only option to move those children out of the hierarchy?

Because the underlying HoverEffectComponent affects the entire hierarchy beneath it (with no explicit option to disable that behavior), the only workarounds I can see aside from moving the child out of the hierarchy would be:

  • Put a separate, no-op HoverEffect (possibly along with another Collider–not sure if it needs a separate one) on the child to override its parent’s hover effect. Perhaps a Highlight effect with an intensity multipler of zero.
  • Use a Shader hover effect and some other means (such as a material property) to enable or disable the effect on a per-material basis.

Both of those would assume that you’re using PolySpatial 2.X/visionOS 2 (since that’s where we/Apple added the additional hover effect customization options). With PolySpatial 1.X, the only option I would think of would be to have a separate HoverEffect on the child and have an empty collider (like a MeshCollider with an empty mesh).

There was also an issue that Apple noted in their release notes (fixed in visionOS 2, I believe) that might affect your results:

Fixed: When a hover effect requested by a HoverEffectComponent is displayed, other hover effects from parents of the Entity with less specific HoverEffectComponents are also displayed. (115299316)

1 Like