UE4: How to cast actor to blueprint interface type

Viewed 2023

I'd like to store a variable of type Actor in a variable which is of a BP interface type.

Is there something like a Cast To BP Interface BP node? I know about the Does Implement Interface (which does not return a reference to the interface instance) and the Cast To (which doesn't work for interfaces) nodes. But these do not allow me to get an instance of my BP interface type.

I know that I could store the actor in a variable of type Actor and then invoke the interface functions on that actor. But that seems like a type system workaround to me. That's why I'd like to enfore the interface type on the variable.

Bluprint node setup

1 Answers

Cast To does work, it just doesn't show up in the context. Disable 'Context Sensitive' or click in an empty place in the graph to create a Cast To node, and then hook it up to your actor.

(Answered on behalf of @Rotem)

Related