Forum Discussion
BTR_Josh
5 months agoExplorer
Disabling RayInteractor
Good Afternoon,
Unreal Engine Version: 5.5.4
Meta Interaction SDK Version: v77.0.0
We've set up a IsdkHandRigComponent on our Pawn and are using ray interactions to highlight and select objects in a scene. We want to disable the Ray Interactor during parts of the level so that the player isn't able to interact with objects, but we haven't found a solution yet.
We've tried disabling the interactable but the cursor still appears when the player hovers the hand over the object. We've considered simply disabling the niagara systems that the UIsdkRayVisualComponent uses but that seems like a bandaid rather than an actual solution.
Is there any way to disable the interactor on the pawns side? We've come across the UIsdkConditional class which might be what we're looking for but can't find any supporting documentation/samples to figure out how to use it.
Cheers
Hi Josh!
Thanks for reaching out.
You’re on the right path - conditionals are objects that either evaluate to true or false and broadcast a delegate when their value changes. You can connect multiple conditionals together to create complex boolean logic.
In this case, the IsdkRayInteractionComponent that sits on top of the IsdkHandRigComponent you’ve created has an IsdkConditionalGroupAll property “EnabledConditionalGroup” that drives whether the IsdkRayInteractor is active or not.The intended way of disabling an interactor is to add an IsdkConditionalBool to the EnabledConditionalGroup via the AddConditional method, and use the SetValue method on the IsdkConditionalBool to drive the interactor component being active/deactivated.
Looking now, it seems that the SetValue method of IsdkConditionalBool isn’t exposed to Blueprint at this time. I’ve raised this issue to the team and we’ll make sure that gets fixed.
If you’re able to work with C++, you can still take the route above. If you’re only able to access Blueprint, I do see a potential workaround for you.
I notice that IsdkConditionalComponentIsActive is fully exposed to Blueprint. The way this conditional works is that you set a component that the conditional observes. When that component is active, the conditional evaluates to true. Otherwise it evaluates to false.
That said, you should be able to:
- Create a new Scene component and name it “RayActivator”
- On BeginPlay, create a Construct Object From Class node
- Set the Class pin to IsdkConditionalComponentIsActive
- Drag the return value pin to a Promote to Variable node and name the variable “RayConditional”
- Call SetComponent on the RayConditional variable
- Set the InActorComponent pin to the RayActivator component
- Drag out a reference to your IsdkHandRigComponent. From there, drag out a Get RayInteraction node, and from that drag out a GetEnabledConditional node. From that node, drag out an AddConditional node and set the InConditional pin to RayConditional
- Now, whenever you want to deactivate ray, call Deactivate on RayActivator. Whenever you want to activate ray, call Activate on RayActivator.
Again, this is just a workaround, and we’ll make sure to get a proper fix in for SetValue not being exposed to blueprint.
Thanks again for your post, let me know if there’s any more information I can provide.
3 Replies
Replies have been turned off for this discussion
- innitAdventurer
Disable it on the pawn side and handle both the ray interactor and the ray visual. Create a Bool UIsdkConditional, assign it to the Ray Interactor’s EnabledCondition and the UIsdkRayVisualComponent’s VisibilityCondition on your IsdkHandRigComponent, then set it to false during lockout and true to restore.
If you prefer a hard toggle, call SetInteractorEnabled(false) or Deactivate and SetComponentTickEnabled(false) on UIsdkRayInteractorComponent, and Deactivate or SetVisibility(false) on UIsdkRayVisualComponent so the reticle also goes away. The cursor persisted because the visual runs independently from the interactable, so you must disable both. Well hopefully that'll work for you :)
- Bit_RotMeta Employee
Hi Josh!
Thanks for reaching out.
You’re on the right path - conditionals are objects that either evaluate to true or false and broadcast a delegate when their value changes. You can connect multiple conditionals together to create complex boolean logic.
In this case, the IsdkRayInteractionComponent that sits on top of the IsdkHandRigComponent you’ve created has an IsdkConditionalGroupAll property “EnabledConditionalGroup” that drives whether the IsdkRayInteractor is active or not.The intended way of disabling an interactor is to add an IsdkConditionalBool to the EnabledConditionalGroup via the AddConditional method, and use the SetValue method on the IsdkConditionalBool to drive the interactor component being active/deactivated.
Looking now, it seems that the SetValue method of IsdkConditionalBool isn’t exposed to Blueprint at this time. I’ve raised this issue to the team and we’ll make sure that gets fixed.
If you’re able to work with C++, you can still take the route above. If you’re only able to access Blueprint, I do see a potential workaround for you.
I notice that IsdkConditionalComponentIsActive is fully exposed to Blueprint. The way this conditional works is that you set a component that the conditional observes. When that component is active, the conditional evaluates to true. Otherwise it evaluates to false.
That said, you should be able to:
- Create a new Scene component and name it “RayActivator”
- On BeginPlay, create a Construct Object From Class node
- Set the Class pin to IsdkConditionalComponentIsActive
- Drag the return value pin to a Promote to Variable node and name the variable “RayConditional”
- Call SetComponent on the RayConditional variable
- Set the InActorComponent pin to the RayActivator component
- Drag out a reference to your IsdkHandRigComponent. From there, drag out a Get RayInteraction node, and from that drag out a GetEnabledConditional node. From that node, drag out an AddConditional node and set the InConditional pin to RayConditional
- Now, whenever you want to deactivate ray, call Deactivate on RayActivator. Whenever you want to activate ray, call Activate on RayActivator.
Again, this is just a workaround, and we’ll make sure to get a proper fix in for SetValue not being exposed to blueprint.
Thanks again for your post, let me know if there’s any more information I can provide.- BTR_JoshExplorer
Thanks for the comprehensive response Bit_Rot,
We discovered that the issue was because the interactable component being used was actually a IsdkGrabbable, using the "Ray Grab" interaction. Part of our confusion was thinking that the Ray Interactor handled the Ray Grab as well, especially when the Ray Grab uses the same niagara system for it's visuals. I'll mark your post as the solution as that solution does work when applied to the Grab Interactor as well.
However, we don't want to disable all Grab interactions and can't find a way to disable just the Ray Grab, so we found a workaround by using the SetInputMethodAllowed method on the IsdkGrabbables to remove them from the list of candidates.
Thanks for your help,
Josh
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 months ago
- 9 months ago