Moveable Light Triggers in Unreal

Along with the nDisplay work this week, I've spent some time looking into triggers and collision boxes that could be attached to moveable actors. A few weeks ago, I had successfully made the puppet in the scene walk into a collision box on the ground to trigger a light to turn on. This time, I wanted to test if I could have the collision box moving throughout the scene.

My first test was to create a simple light trigger based on collision in a blueprint and attach it to a moving actor. For this, I chose a sphere that had physics applied, which would fall to the ground at the beginning of play. I created the collision blueprint separately without any objects inside, so the blueprint could be duplicated and used with different actors in the scene.

In order to get the collision box to follow the sphere as it fell, I parented the blueprint in the scene to the sphere actor. The parenting worked as I hoped and next, I made sure that the collision for the light trigger was working. I played with the collision settings of the sphere and ground plane actors in the scene. Turning off collision for the sphere object made sure the light wasn't triggered as the blueprint followed the sphere, and turning it on for the ground made sure the impact would make the light turn on as needed.


After making sure this simple setup was working as expected, I took the next step by working on a moving, playable character in the scene.

This time, instead of creating a new collision blueprint, I worked directly in the "third-person character blueprint". Since we will only have one main character (the puppet) in the scene, it didn't matter if I created a blueprint that could be duplicated for non-deforming actors.

I added a smaller collision box to the viewport along with a point light above the head of the character and positioned them as needed. For this test, I wanted the light to be triggered when the character's right hand collided with something. At first, I tried to follow my previous idea of parenting the collision box to the character. However, parenting to the character itself would not make the collision box follow the arm movements specifically, and there didn't seem to be a way to pick the joints in the details panel to parent the box to them.

Thankfully, a quick search online led me to a setting that already exists in the character blueprint for the exact use case that I need!


After selecting the collision box from the "Components" panel, I went to the "Sockets" details and picked the joint that I wanted to attach the box to. For the sake of testing, I also moved the box a little further away from the character's hand to avoid collisions with the rest of the body.

So far my tests have worked very well for proofs of concept. If we decide to use these triggers in our final performance piece, my next step will be to implement the blueprints for our puppet.



Comments

Popular posts from this blog

DMX in Unreal Engine

Final Tests on CRMX

Pixel Mapping