Trying to call event from another blueprint

Hello, I’m having problems doing something simple: Calling an event from another blueprint.

Everything compiles and runs, but it’s as if the event never gets triggered:

Here’s the BP that’s calling the event (Notice the variable on the left):

And here’s the BP that I’m trying to communicate with:

Seems simple, any idea what I’m doing wrong?

You need to cast to the other BP

Like this? (Not working)

What is the other BP exactly?

It looks like you want to trigger the print from another BP when you click a button right? What is the other BP?

Right, just show a string letting me know the command got there.

It’s Va Rest: [Plugin] Http/s REST, blueprintable JSON and Parse REST API manager at once (VaRest) - C++ - Unreal Engine Forums

Here’s a screenshot with a little info:

Hmm, well I don’t know what that plugin is, but if the cast is failing then the reference must be wrong. You could try getting all actors from the VaRest BP, and as that, cast to it.

I tried installing the plugin to try myself but I couldn’t figure it out…

Sorry if this doesn’t help!

I made another one and used the Actor class. Ran into the same problem. Pretty basic:

And the blueprint we’re calling it from:

If the cast isn’t firing then the reference is wrong. You should try what I mentioned and casting to the BP you’re casting to. I have no idea if this is the “correct” way to do it, it’s just how I’d do it.

I made this real quick to show you what I mean (When I press button, it call the event in a separate actor class):

wMw1qf7.png

oejBqym.png

3 Likes

“Get All Actors of Class” with the array worked. Still not sure why the other technique didn’t.

I here ya, I don’t know why half the things I do work or don’t!

But, glad it did anyways. Hopefully someone else has an answer.

2 Likes

Thanks! If you want to post here: Can't call event from another blueprint - Programming & Scripting - Unreal Engine Forums

I’ll flag as the answer.

i still don’t really understand casting. I’m following the “endless runner” video tutorial and he uses it a lot, and when he does use it, I feel like I get it, but if I try to do it in something i make myself I’m just like, wtf, how does this even work? xD

I have read the documentation about it but if anyone could explain it in more detail including when it should be used and when not to use it, that would be great :slight_smile:

I just want to keep certain events and functions organized in a blueprint I can call later. Casting should let me call those events easily whenever I want. Most of the video tutorials I’ve seen cover how to Get/Set variables. But I just want to call “events”.

Chances are there’s an easier way I don’t see yet (Blueprint Interfaces?)

This MSC variable, you will need to assign a value to it before you can obtain any results from calling it. Think of the variable as an empty house, and of any one instance of your MSC blueprint class as person.

When you call an event from the variable, you are actually knocking at this house (the variable)'s door. If there is no person (the instance of your MSC class) living in it, no one will answer the door :). When you assign a person to live in the house, he or she will answer your call.

I see you try to call the MSC variable from a Widget Blueprint. Try this. Open your level and create an actor of the MSC class anywhere. Then go to your Level Blueprint, and, on Begin Play, assign the actor you just created to the MSC variable in your Widget Blueprint. Then see if it works.

Like this? (Keep in mind, I’ve already created an Actor based off that class and added it to the viewport.)

Just woke up, but that should work. You shouldn’t need to cast in this case. Try it with and without casting :).

Your problem is that your variable MSC inside Splash_Side_Menu is never set.
The easiest way to set it is when you create the widget, you almost have it.
I’m assuming MSC is a blueprint in the world somewhere so you can get a reference in the level blueprint. If not you will have to use the get all actors of class after it has been spawned like has already worked for you.

Select MSC in your level then open your level blueprint, right click and create a reference.
Now on the Return Value on Create Splash_Side_Menu drag off and get a set MSC. Then connect your MSC reference to the set.
This gets the MSC from the world and sets the MSC variable inside Splash_Side_Menu to reference it.
9de40b1af8fcebb815176068bb1a7eb176de4c70.jpeg

Now in Splash_Side_Menu you don’t need to cast or anything simply drag MSC onto your event graph and drag off it get custom function, then connect to button.
f4ab7b20eb69ca7198364854b8b0d7b41a7da709.jpeg

Hope that helps explain it.

This Thread just saved my day. THANK YOU GUYS HAHAHAHA

I’m trying to use this through interfaces but it does not trigget the event, i don’t understand why.

Show us what you did.