VR: How to create a flashlight that can toggle as its own BP class?

Hi, I am very new to UE5 and blueprints. I have completed some tutorials on hand animations and sockets.

To be brief, i am trying spawn a flashlight in my level, be able to walk over to it and pick it up, and then be able to toggle it on and off.

All tutorials tell me that there should be a get attached actors node but I cant seem to find it.

I have:
-Created a custom input mapping to desired buttons

  • Set up the flip flop function as the toggle switch in the torch_BP
  • Tried to cast to the torch_bp with VR Pawn event graph to call the toggle

The cast node is asking for an object that I cant seem to figure out, this is where the previously mentioned get attached actors node is supposed to be.

If anyone could help that would be appreciated. Thanks

1 Like

Did you ever figure this out? If so, do you mind putting up the blueprints? I am having the same issue in VR. All of the tutorials that I have seen are either in UE4 or not in VR.

1 Like

Hi all, welcome to the Forums.

I have a bit of guidance here.

In that second screenshot you’re casting to your Flashlight(BP_Torch) blueprint, but are feeding it the Motion Controller Component (Motion Controller Right)

What you’d want to do is get all actors that are attached to your Motion Controller Component, and if one of those is the flashlight, you’d do the cast and then call on/off functions in the flashlight.