Hi,
Question:
Is it possible to cast an actor reference to a type that is set by a variable?
Why?
Here is my problem:
Say we have an ActorBP that does stuff based on variables.
Now I spawn an instance in another BP:
So, in the spawn node I can set all my parameter and it all works nicely.
But now I want to make the spawned actor class depending on a variable:
So now the variables in the spawn node are gone and all I get is a (generic) actor reference.
In order to set my variables, I would need to cast the reference to the class that the variable “class” holds.
But it seems that in order to cast to a type, the type must be known:
What I need would be a kind of “cast to” node that takes a variable of class and casts to that.
I havent found such thing. So Im guessing its not possible.
Is there any way to achieve what Im trying here
(As a last resort, I could supply an additional enum and switch to spawn nodes like in the first screenshot, with one for each type and then cast to that type. But that would mean the user has to keep the class variable content and the enum value in sync manually. very error prone…)