I’m using the widget interaction component childed to the VR motion controller component. There’s a giant red arrow that gets rendered from the component, and I’m wondering if there’s any way to remove it? Setting actor hidden / visible doesn’t do anything. Unchecking ‘Enable Hit Testing’ removes the red arrow, but then I can’t interact with any of the widgets.
Anyone know how to do this?
Hm, I just tried this with the VR template that Epic provides and don’t see the red arrow appearing anymore. Not really sure what the problem was, but I’ll just use the Epic’s motion controller blueprint.
Red arrow can be disabled by unchecking “show debug” option in “debugging” section of widget interaction class component (valid if you are using 4.13/4.14 VR template)
I can do that manually, can it be done programatically? aka, I want to activate and deactivate the pointer
Hey, that’s how i managed it
1 add a bolean variable
2 - set ur even starter ( ur hot key to disable or enable the pointer
3 take that event starter through a flipflop node
4- alt+drag that bolean variable ( 2 of them )
5- connect them same way shown on that image.
note :to get that widget interaction reference u just need to drag it from the components menu
hope that will work for u
Instead of removing it you can access it’s properties and edit it as you wish.
For that you need to create a child of UWidgetInteractionComponent and add UArrowComponent UPROPERTY there.
Then you need to get defaul subobject called “ArrowComponent0” and save it to your UPROPERTY.
Additionally you can disable visibility in OnComponentCreated function.
.h
UCLASS()
class MYGAME_API UMyWidgetInteractionComponent : public UWidgetInteractionComponent
{
GENERATED_BODY()
UMyWidgetInteractionComponent ();
virtual void OnComponentCreated() override;
protected:
UPROPERTY(EditAnywhere)
UArrowComponent* Arrow;
};
.cpp
UMyWidgetInteractionComponent ::UMyWidgetInteractionComponent ()
{
Arrow = Cast<UArrowComponent>(GetDefaultSubobjectByName(TEXT("ArrowComponent0")));
}
void UMyWidgetInteractionComponent ::OnComponentCreated()
{
Super::OnComponentCreated();
if(IsValid(Arrow))
{
Arrow->SetVisibility(bShowDebug);
}
}
After than I am using only UMyWidgetInteractionComponent and I am able to control arrow of widget interaction component.
class MYGAMEAPI AMyMotionController : public AActor
{
GENERATED_BODY()
public:
AMyMotionController();
protected:
UPROPERTY(EditAnywhere)
UArrowComponent* WidgetInteractionArrow;
};
AMyMotionController ::AMyMotionController ()
{
WidgetInteractionComponent = CreateDefaultSubobject<UMyWidgetInteractionComponent>("WidgetInteractionComponent");
if(IsValid(WidgetInteractionComponent))
{
WidgetInteractionComponent->AttachToComponent(MotionControllerComponent, FAttachmentTransformRules::KeepRelativeTransform);
WidgetInteractionArrow = WidgetInteractionComponent->Arrow;
WidgetInteractionArrow->AttachToComponent(WidgetInteractionComponent, FAttachmentTransformRules(EAttachmentRule::KeepRelative, false));
}
}
And now in my BP_MyMotionController I am able to configure that arrow.