So i want to make two blueprints talk to one another
Im still learning and ive looked at the blueprint communication documentation but cant work out/get it to work using any of the methods
Im using the first person template and applied ray casting with E, i want a button blueprint (which i have responding to interaction with the ray casting) to broadcast to a specific light and toggle it on
I think i need to use casting or interfaces but dont know enough
If anyone can shed some light on this for me (pun not intended), i would really appreciate it as it would provide alot more scope for future ideas i have
In the LightBox blueprint, you’d want to cast to ButtonStand to get a variable that changes when the ‘On Interact’ event fires after being pressed by FirstPersonCharacter, using this variable to control the light.
that would be what i would go for, but i was under the impression (from other threads) its bad practice to use tick, but i suppose if its in a branch its not demanding much memory
I managed to work it out with casting, re-reading the documentation over and over again in bed this morning it clicked
Ive posted a screenshot of the solution below
For anyone who may look at this post in hopes to solve this themselves, this is how it works
The event triggers everything, for me its an interaction script but can be any event
The “Cast to LightBox” needs an object, which is a wildcard and can be a range of things, for me its an Actor Reference as i want it to target a specific light/actor in my scene, this variable is editable so i can select it from the game window
Once compiled i just select the lightbox in my scene with the dropper tool
From the cast, i just drag out from “as lightbox” (this will change depending on what you add into the “object” pin) and searched toggle, it connected them up with a target node automatically
Then just hook it together and it worked! the light now toggles on and off with my interaction.