I would like to build a simple light switch blueprint of a tablelamp in my project, but I haven’t found the VR compatible light switch tutorial in google. I show you my blueprint that doesn’t work. The point light would be visible or invisible if I touch it with virtual hands.
I’ll appreciate your help!
I admit that the previous blueprint is bad, so now I made simple one. However it doesn’t work too. I would like to tell you, I don’t expect that you’ll solve all of my problem or develop my project. I just stucked with this issue and I make an effort to solve it and ask fewer questions here. I think if I’v finished it I’m over the hard part and I can continue the developing safely.
Sorry, I hate to bother you again, but I rejoiced at it too early. It works but not a good method. I think the trigger sphere is better solution so I packed it around the point light. My plan is that when my virtual hands enter the trigger sphere the point light turns on or off. In the picture this is the Level Blueprint. The lower blue components work, I tried with GrabRight. However I don’t have any idea how to connect the upper components to them with “As Motion Controller Pawn” pin.
Not a good idea to put the logic in the level blueprint. You should add the trigger sphere directly to the light BP. Then you use a begin overlap event (and and end overlap event) inside its Event Graph. Get the overlapping actor out of the overlap event, cast it to Motion Controller BP. If the cast is successful it means a hand is inside the trigger sphere and you can toggle the light.
I’ve red your advice again and again but I cannot place the trigger sphere into the light BP if you mean the “OnActor BeginOverlap (Trigger Sphere)”. According to the documentation and tutorials the trigger actors are used to activate events placed inside of the level blueprint not in the others. Did I misunderstand or miss anything?
Sorry, you are right. Should not have used the Trigger term as this misled you.
What I meant is that your light BP should contain a collision sphere as root component, which will act as “trigger” for the OnActor BeginOverlap event.
Now, I’ve connected the Exec pin out of the Begin Overlap to MotionControllerPawn. Other Actor is pinned too as you mentioned. It should work, but still not.
The collision sphere should be the root of your light actor. Place a Print String after the Overlap Event to check whether it is triggered. Place another one after the cast to make sure the cast is successful. Keep doing so until you find out what is wrong.
In VR it is difficult to see the output of Print String inside the HMD, but you can always check it in the log afterwards.
5. Place the Light_BP actor somewhere in the Level. Play in VR, teletransport to it, stick your hand through and the light will turn off. Stick in through again and it will turn on.
Finally everything is fine! I hope. Thank you for your help and patience. I think the problem was that I made a BP from point light not from the scratch based on Actor.