[SOLVED] Touchable light switch blueprint

Hey there,

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! :slight_smile:

Janos Csaszar

Hi again,

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.

Janos Csaszar

Your last version should work. How did you map the GrabRight input action? Where did you place this Blueprint? In the VR Pawn or in the level?

Hi! The GrabRight is in VRPawn’s Blueprint that is default. And the point light’s graph is in its own Blueprint.

Can you try to replace the GrabRight event with a Keyboard → A key event. The play in VR. If you press A do you see the light change intensity?

Wait a moment, did you set the point light blueprint to receive player0 input? In the properties?

Wow, you’re genius and helpful as always! Thank you very much! :smiley:

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.

Okay. Could you tell me what’s wrong in the picture, please? The input is on Player 0.


Like that you forgot to connect the execution pin out of the Event? Plus you should cast out of Other Actor not Overlapped Component.

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. :frowning:

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.

Ok, let’s start from scratch because this should work out of the box. Do like this, starting from a blank VR Template project:

  1. Create a new Light_BP based on Actor
  2. Now edit it and add a Collision Sphere. Make it the root of the actor
  3. Add a Point Light and parent it to the Collision Sphere
  4. In the Event Graph, add this code to the ActorBeginOverlap event (see below)

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. :slight_smile: 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.