I am relatively new to blueprint scripting but been able to accomplish what I’ve need to so far. The big issue I am having is communicating between BPs. I have tried every example I could find - including those directly from the BP Documentation and can get none of them to work.
I have a custom event in an Actor Blueprint. I am trying to trigger the event from a HUD blueprint. I set an object variable to target the Actor Blueprint. Is there any reason why this should not be working?
That object variable which targets your Actor blueprint … what’s the variable type on that? If it’s just a simple Object or Actor variable, then you’ll only be able to see what properties and functions are common to all Objects or Actors, not any children of those (meaning the custom stuff you’re making). Two ways to fix:
After dropping your object variable on your HUD blueprint, pull off the blue pin and type “Cast To”, then choose whatever kind of actor that other guy is… say “Cast To MyExcavator” or whatever you called it. You’ll get a new blue pin (called As MyExcavator etc) from which any custom events you wrote in that other blueprint will be available (such as the function OperateExcavator).
Another way to fix would be to simply change the variable type to MyExcavator directly instead of being a simple Object or Actor variable type. Quick caveat here, you will notice the dropdown for that is greyed out if you’re using that variable already on your blueprint. Either create a new one, or go delete the old one everywhere it exists in your HUD. If you do get the dropdown open but don’t see the correct type - try typing a few letters in the search area near the top and it will probably go find it for you. [You’ll see two … don’t pick the version ending in “_C” btw].
Personally, I would suggest using interfaces. They are less confusing, and more flexible in the long run than the event system, and you don’t see as many bugs in the menus as you do with events. For interfaces:
Create Interface blueprint.
Create function template in blueprint
Compile the Interface
On Object with event> Open the blueprint properties and implement the interface
Compile the object
The function definitions from your interface should not be propagated to your object BP.
In copy your event into the function (without the actual event node itself) and hook it up to the function call.
Wherever you are calling the event, find your interface message and call it.
Thank you both so much for your responses. Based on your input I was able to solve my problem and get things to work.
Trying to learn Blueprint scripting is kind of like taking a walk in a Swamp without knowing what is solid ground and what is “Quicksand”! LOL. Seem you also have to watch out for getting snake bit also!
Thank you Again!