Hello, I have multiple models that use different shaders to create hover effects. How can we make one of these models hover while the other models also switch to hover state?
vision RCP models Hover
Hi @MaoChao,
You can make multiple models display their hover effect at the same time by using the hoverEffect.groupID property on HoverEffectComponent in Xcode. When a person hovers over an entity with it's groupID property set, all other entities whose hover effect shares the same groupID will display their hover effect at the same time.
For example, say you have an entityA and an entityB loaded in Xcode which both have hover effect components and materials authored in Reality Composer Pro. You can ensure these entities display their hover effects together by putting them in the same group, as follows:
let hoverEffectGroup = HoverEffectComponent.GroupID()
entityA.components[HoverEffectComponent.self]?.hoverEffect.groupID = hoverEffectGroup
entityB.components[HoverEffectComponent.self]?.hoverEffect.groupID = hoverEffectGroup
Now, both entities hover at once when you hover over either one of them. For another example, see Grouping multiple hover effects.
That said, if you're looking to group hover effects exclusively within the Reality Composer Pro editor, there's no supported way for you to do that at the moment as far as I'm aware. If you'd like us to consider adding the necessary functionality, please file an enhancement request using Feedback Assistant. Once you file the request, please post the FB number here.
If you're not familiar with how to file enhancement requests, take a look at Bug Reporting: How and Why?
Thanks, and let me know if you run into any issues!