Cast to a Blueprint Actor

Hello i have a Blueprint Actor and in this a Function

i want to call this function from my Character but not work, only with get all actors of class work but not with cast to what i make false?

what i need add as object in cast to? i try self

and i try a variable with reference to the Blueprint.

Usually it’s Get Owner for object, or Get Player Pawn when you cast to the player actor pawn character…

not work :frowning:

only get all actors of class work

Depends from where you are calling the function. If your function is inside the character blueprint, you need a reference of the character saved somewhere (e.g Game Instance), unless you are calling it directly from inside the character blueprint. If you can give us some more details about what you are trying to achieve and you have right now we’ll be able to help you better.

ok i make a Blueprint Actor and want to call a function or a custum event in this BP.

this blueprint is in the world placed.

now i want to call the event or function via button from character or controller but this not work, buit work if i make with all actors of class. but i want cast to.

Well you need a reference of it. You can make a reference in your game instance, and when this actor is created, it saves a reference of itself in the Game Instance, then from your character, access the game instance and get the variable.

how you mean that

make a variable with reference to my blueprint in my instance?

Edit: dont work

I cast to my game instance in my character and fire to a custom event in my instance

in my instance have a variable with reference to my blueprint

the custom event fire to my blueprint function

This page might help you:
https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/ReferenceAssets/Blueprints/

Epic had a video on it but I can’t find it sorry

If you post a screenshot people can better assist you. Otherwise we can just point you to tutorials and general documentation.

In your first person character create a variable. Change the Variable type to the NAME of your BP Class Actor in the scene (Variable Name drop down).

Create a Function inside of your BP Class Actor … call it “testfunction” or whatever and compile

Inside your FPC again, Right click and type in the name of that function.

The target input of that new function is your Variable you created above.
The Character is Self.

Try that.

Jerry

That i tryed before i post this here not work only all actors of class work