Custom hover effect

Hey,

How can I access to world/screen point where player look? I want to create a custom hover effect ( change custom shader property ) but I dont know where can I find this position to make a raycast

Best!
Marcin

Unfortunately, this isn’t really possible. VisionOS doesn’t provide us with hover data; it only notifies us when interactions are performed. The only hover feedback available at present is via the PolySpatialHoverEffect component, which is backed by the RealityKit HoverEffectComponent (which has no customization options).

Oh ok, so maybe there is a way to get an events for HoverEnter and HoverExit for this MonoBehavior? If not do you have any plans to add it? I want to shoot hovered enemy with pinch, but I don’t know which GameObject is exactly hovered if there is one

There’s no way for us to provide those events, because that information simply isn’t provided to us (or to any other application) by RealityKit. The HoverEffectComponent causes RealityKit to change the appearance of an entity when it is hovered over, but it does not provide a way to know what is being hovered. We only know what is being touched when we get the pinch event.

A follow up question to this:
Is it possible to modify how RealityKit changes the appearance of the entity that’s being hovered over? The highlight it provides simply isn’t strong enough in our case to really make it obvious to the user what’s being looked at.

Edit: I’ve submitted feedback to Apple, requesting that they add parameters to the HoverEffectComponent that allow us to tweak the effect.

5 Likes