Is it possible to Dynamic Cast in Blueprint?

In an attempt to be succinct, I am trying to create an Enemy Spawn Point so that my Designers can drag a single object into the scene and decide what enemy to spawn from that single object.

In order to properly pass variables associated with their pathing on spawn, that I have found, is to cast to their blueprint type and grab the variables. Making this multi-use Spawn means I need to be able to dynamically cast based on the Enemy they chose to spawn from it. Is this dynamic casting possible in blueprint? Should I just make another type of Spawn Point?

I found a solution. For the sake of answering my own question for others to reference.

When you ask it to cast to an object on cast fail you can try to cast to another object. Dynamic casting can be accomplished by a string of cast to’s it may not be the most efficient, and if there’s a better method I’m all ears but this will serve my purpose for now (excluding just setting it up in C++ which Im sure would have been easier).

Better way of explaining with a more concrete example.
Cast to Drone → Fail → Cast to Bombast → Fail → Cast to … → …

The best way to tackle something like this is to create a base class with the shared functionality you know all units will need (or might need) and then take advantage of inheritance to expand off this base class into your unique unit types. This way, you only have to cast to BaseUnit and then call the appropriate functions there.

Huogo - you solved my problem i encountered with stack counts of spawned actors i drag from my inventory to drop out into the world (trash… or passing items).

This allowed me to take the selective items that are stackable, run them through a dynamic cast such as mentioned and pass on the variable of STACK COUNT to the newly spawned item, which wasnt able to be calculated due to not having a STRUCT reference on the newly spawned item.

Perfect solution! Many thanks for being responsible to your own inquiry and posting your fix <3 Wish more people were as influenced as you are with their solutions… most just say “I got this fixed…”

You know I had an almost identical question a long time ago, and the answer never occured to me until now; there is probably a better way to do this, but none that I’m aware of.

I am again running into this same issue years later and I still fail to see how this resolves the problem at hand. The issue is that a) you have a class derived from another, b) you want to check if an object is of that class and c) you don’t know at compile time which class to check for because you want a user or the system to decide what class to check for at runtime.

For instance, as a specific example say I want someone else to be able to specify a class in the editor as a Class variable in blueprint use that class to create a widget at runtime (which always returns a User Widget and not any derivative class) and then cast to THAT specified class in order to use features of the derivative class later – features exclusive to that derivative that are not, and should not be in the base class. There is currently still – to my knowledge – no way to do this in Blueprint.