How can I call a function in my aicontroller blueprint from my level blueprint?

I have referenced my aicontroller blueprint as an object variable in my level blueprint and am trying to call a function within it, but the custom event in the aicontroller is not being activated.

Here is my level blueprint setup:

and the aicontroller:

15630-aiontroller.png

Any ideas what I’m doing wrong?

Thanks in advance.

How exactly do you set your “Random Player Movement Blueprint” in your Level-Blueprint?

I would assume that this one is empty or at least not referencing the object you want.

Also… not that I want to critique or ask exactly what you’re doing but getting inputs in your levelblueprint seems kinda weird.

Thanks for your response. It is set using an object variable with the variable type set to the aicontroller blueprint that my characters are using.

15644-objectvariable.png

I’m aware that setting inputs in the level blueprint is not typical but it works for the current application.

Thanks again.

Well the way you set it up you have a variable of your AI controller but not an instance of it.

Imagine you want to get a bucket full of water. You have a piece of paper where the location of the bucket is written so you can pick it up. However in your case the paper is empty and right now you’re holding the paper under the water.

Depending on what you want to use and how many instances of your controller are running around you have a few options.

If it’s only one use “Get All Actor from Class” and set the pawn you used. Then get it’s owner and set the “Random Player Movement Blueprint” with the result of that (you might have to cast that controller to “Random_Player_Movement” (or whatever exactly you called your AI controller.

Thanks for that, I’m still struggling unfortunately. I have four instances of the character using the AI controller.
How would I go about communicating with all four instances simultaneously?
Thanks again, really appreciate your help.

Well have you thought about not talking to them but to let them get the information from somewhere else?

If you don’t want that you can use “Get all actors from class” which will output an array of all characters in your current level.

You can go through them with a “For Each” loop which would get you where you wanna be as well :wink: