Static asset reference in C++ class hierarchy

i wish to set up a static reference to particle system asset (resides in content browser)

the problem is i cannot specify that asset in “class defaults” in a child blueprint, because the C++ class i need it in - is base of a C++ class hierarchy!

let’s for convenience imagine that’s the desired case:

C++ class Base // has static UParticleSystem reference

|----C++ class Child1

|----C++ class Child2

|----…

±—C++ class Child999

how can i achieve this? thanks in advance.

You set defaults in constructor of the class by simply setting variables in there, changes there will surface in to class default object which will apper in blueprints. You can use ConstructorHelpers::FObjectFinder to reference specific asset in costructor.

Also UE4 reflection system and there for blueprints don’t support static variables if you mean that

that’s a bummer. supporting static variables could hugely improve RAM performance.

Well you only saving 64 bits aka 8 bytes (half of that if you build 32bit) from class object footprint with single pointer

Why don’t you try to set Particle System directly in to component from C++?

With 10 such variables per class, and 100 instances - it easily becomes 8kb of RAM

i rather have 150 instances with the same cost and functionality :]

I’ve tried to dynamically spawn a particle system from C++, but it led to runtime errors and i didn’t figure out how to solve it. Wanna take a look at the output?