How to cast to an actor with a certain variable value?
I've been looking for an answer to this a lot, but couldn't find anything useful. Basically, I'm trying to make a system where a switch actor is supposed to activate a door actor. Doors and switches are connected with an "ID" that is an instance editable integer variable. Switches are supposed to activate doors with the same value. The problem is that I can't find anything to plug into the Cast node that will specify the actor with that integer.
I probably don't need the part that checks if the values are equal if I can get that to work
You need a reference to the door. If your door is a BP and placed the door in the world, then you can make a variable of that type in the switch BP and click the eye to expose it in the editor.
when you place that bp in the level, you will be able to set that variable in the details panel. You canselect a door in the level with the eyedropper.
You could also, get all actors of class like this:
either way, you need a reference to the door. Other options would be an interface or event dispatcher.
Hope that helps! GL!
Follow this question
Once you sign in you will be able to subscribe for any updates here