Looking to use bluprints as a base class with overiden funtions without spawning it.

I am looking to use blueprints as a base class with overridden functions without spawning it. Library does not work do to no override existing for it. This could be used for traits or status. Is there anyway to do this?

Blueprint without spawn does not work. But you can try to use CDO (Class Default Object) as a “static” object, and call functions in it. But I do not remember anyone doing this, or at least recommended it.

And why can’t/don’t you want to spawn blueprint instances? :thinking:

1 Like

It is a strange request for sure, can you explain a bit more of your set up? Probably would be a better way to do it since you can’t access blueprint functions without an actual instance, only exception are function libraries. I think in c++ is possible tho, but still something I never heard of

You can get the CDO for any Blueprint using:

BlueprintAsset->GeneratedClass->GetDefaultObject()

CDO is also created for libraries. Blueprints call functions in it.

Yes, C++ has static functions that can be called without creating an instance using:

ClassName::FunctionName()

But they have some limitations.

you can’t use class defaults to access the functions in blue print

It just works (c)

If you do not use functions that require a world context (for example, PrintString), there will be no warnings.