What am i supposed to do to connect blueprints?

Its been about 10 days since i started this, but i still dont get it.
I wanted that OnClicked (StartWave_Button) it at least Print String “StartWave Called” from first picture (which is UI Widget) , and Print String “SpawnPoint is active” which is in an actor blueprint in level. But the second one (after Start Wave custom event) is not doing anything. I thought that i can call custom event with reference from another blueprint, but i guess something is there that i still dont get. It may help that i get accessed none error while doing this OnClicked event. I guess that is somehow linked to get reference node, but i just dont understand how to fix it.

http://https://answers.unrealengine.com/storage/temp/192674-ui1.jpg

http://https://answers.unrealengine.com/storage/temp/192675-actor.jpg

I tried to put Cast to here , but i dont get what supposed to be in Object pin. Because i used Self, Spawn Point Ref, Actor ref, and none of it did anything… help me

Hi Banarcher,

You need to cast to the owner of the event:

example:

Actor 1 - Event Start Wave.

Actor 2 - get reference to Actor 1, then cast that reference to Actor 1. then drag off from the “cast to” actor, and that would give you accessibility to the event

or if your reference is not set correctly it would also cause the blueprint not to run :).
test with get all “actors of class” and run the events with a for each loop, to ensure there are no reference issues in your blueprint :slight_smile:

attached an example of both

Casting

Get all Actors

Thanks for replying, however, nothing has changed.
I tried to use Reference variable type “Actor” and another one Reference variable type “Spawn Point reference” and both result in null on print string (Cast Failed).
I also tried to do this with your testing suggestion, i put Actor class as “Actor” and “SpawnPoint” and it resultet in null too.
I tried using both Interfaces and custom event through casting - none.

Thats really strange for me that if i use reference - it says that it accessed none (reference is empty), while if i use that reference and cast it, it says that it is the same as reference and should always be success on casting, but still it fails.

I think that my problem is HERE,

192785-spawnpoint_ref.jpg

that this reference references to “None”, however, i cant change it since it says "Editing this value in a Class Default Object is not allowed.

Or maybe it is not how you do it in a widget blueprint

your issue from what i can tell is you are not setting the reference at all.

(what I mean is how are you telling the (Widget) that the spawnpoint reference is the actor you want ?).

the variable you are referring to is a placeholder, not the actual object. you need to set that variable as the object (spawner) you want

your cast will fail if the variable is not set. pointing back to your error “cant cast to null”

But thats the point, how can i set reference variable to reference an actor, if i cant access that actor or point at it without a reference?

Banarcher, i wpuld recommend watching a few tutorials on how to communicate with different blueprints… there are multiple ways of doing this…

a quick method that i could recommend for testing is running the find all actors of class on your player controller… if you only have 1 spawner on the level… use the get (copy) node from the all actors array output and get 0… the first entry … promote this to a variable.

when you create the widget (I saw you enabled expose variable on spawn) assign the object to the variable when you create the widget.

Then cast in the widget again…

that is the easiest solution i could recomend now to test with… but again i recommend you brush up on tutorials as to how blueprints work… this is some of the most basic communication you will need… and if you neglect understanding this. Blueprints will only become harder not easier in the future (talking out of personal experience) dont avoid the fundamentals

Hello Banarcher,

You need to copy the blueprint class into your level before you can set the reference value.

Make sure Instance Editable is switched on for your variable otherwise is will not be visible in the level instance of your blueprint class.

You want to Cast to the event from the other blueprint. Here’s the documentation: Casting Quick Start Guide | Unreal Engine Documentation

Pass the Actor to your Widget. No refference == No Communication regardless if you Cast it or not its empty by default :stuck_out_tongue_winking_eye:

Here a Video recommandation on BP Communications you should also find a couple Answers on AH I did Answer that kind of Question a couple times already.

Hi Banancher,

I think that you need to bind the event to the button, like in the picture:

Hope this helps

I appreciate your help, but as i said many times, i’ve watched lots of tutorials, and this is the only thing that really stands in my way. I mean i even rewatched that tutorial with Zak about 3 times and it seems like i cant even see him talking about how to properly set a reference (my tab for this is just greyed out and not active).