Download

Change light intensity attached to my Camera using a world trigger box? (Unreal VR Template)

Okay, so I thought I had figured this out using Blueprint Communications, but I am still lost.
I have a Spotlight that is attached to the Camera that is all part of the MotionControllerPawn and it follows my head movement like I hoped. “SpotLight_Helmet”

I would like to have a Trigger Box (TESTERTEST) in my level that can change the intensity of the SpotLight_Helmet when the actor overlaps it. I created a Trigger Box BP (TESTERTEST) and tried to Cast it to that Helmet_Light inside of my MotionControllerPawn, however, nothing happens when I move into that Trigger box. This is how I setup the Tigger Box Blueprint…

No matter what I set the light intensity to, nothing happens. Any ideas?

I know it looks like I didn’t Compile it in the image, but I have tried that as well.


There is a simple explanation to that. The standard VR Pawn which comes with Epic’s VR Template has nothing capable of triggering Overlap events in it, hence it will never trigger the OnBeginOverlap event of the trigger box.

Here is a simple workaround: attach to the VR Camera of your Pawn, above it or below it, a cube mesh (any mesh will do anyway) and make it invisible. Set the size of the mesh so it is large enough to overlap your trigger box when at the distance you want to head light to go on. Make sure it generates Overlap Events that set its collisions to OverlapAllDynamic. This is all you need in the VR Pawn.

Place a Trigger Volume in your level and select it. In the Level Blueprint, place a OnActorBeginOverlap Event for that trigger volume. It is not needed that the Trigger Volume is a Blueprint. Drag out of the Other Actor pin and Cast to MotionControllerPawn (assuming this is the Pawn you are using). Drag out of the As Motion Controller Pawn pin and set the property for your headlight (visibility or intensity) to whatever you need.

That’s it. Now it should work as expected.