diff --git a/Source/WidgetInteraction/Private/VRWidgetInteractionComponent.cpp b/Source/WidgetInteraction/Private/VRWidgetInteractionComponent.cpp index 582e8597e8f52474f6e8856fb149dee5d190a459..54a083659aef59a37620ef6b3af75498d31698db 100644 --- a/Source/WidgetInteraction/Private/VRWidgetInteractionComponent.cpp +++ b/Source/WidgetInteraction/Private/VRWidgetInteractionComponent.cpp @@ -16,6 +16,7 @@ UVRWidgetInteractionComponent::UVRWidgetInteractionComponent() { if (MeshAsset.Object != nullptr) { InteractionRay->SetStaticMesh(MeshAsset.Object); + InteractionRay->AttachToComponent(this, FAttachmentTransformRules::KeepRelativeTransform); //InteractionRay->SetRelativeRotation(FRotator(0, 90, 0)); } } diff --git a/Source/WidgetInteraction/Private/WidgetInteraction.cpp b/Source/WidgetInteraction/Private/WidgetInteraction.cpp index cf653cc8fcf3840a01361675cd90def210a1dc69..f2923cb605affcd938eb9c7f143d554c3398fa1b 100644 --- a/Source/WidgetInteraction/Private/WidgetInteraction.cpp +++ b/Source/WidgetInteraction/Private/WidgetInteraction.cpp @@ -51,11 +51,6 @@ void FWidgetInteractionModule::OnWorldTickStart(ELevelTick level_tick, float val if (vr_pawn == nullptr) continue; - - FString name = ""; - UClass* component_class = UMotionControllerComponent::StaticClass(); - - auto right_hand = vr_pawn->GetRightHandComponent(); CreateWidgetInteraction(vr_pawn->GetRightHandComponent(), vr_pawn); last_world = world;