Predefine array of struct with actor members

rebusb
Wed, 23 Jan 2019 21:24:17 +0000
Editor Scripting

This is for game logic. I have a number Switch Actors instanced in my level. Each switch can be off or on. I am trying to create an array of the switch instances with the correct state that solves the puzzle. Made a blueprint struct called SwitchKey that has two members: a reference to a Switch Actor, and a bool for the correct state.

Want to have a predefined array of these structs in the level or game blueprint that I can check against so when all the switches are set to the correct state the puzzle is solved. I figured a for each loop over the struct of SwitchKey, get the actor ref, compare the state, etc…

The problem is even though I can create an array of SwitchKey structs and add the needed number of elements I cannot set the default switch actor references to point the the switches in the level. Tried soft references in the struct but I still cannot set the values. How do I connect to the switch actors from the level to the array of structs before runtime?

11 posts - 1 participant