Spawn Actor with "Expose on Spawn" properties in C++
I'm trying to change the color of a projectile that I'm spawning in C++ code. I have a projectile color property on the projectile class and I'm applying this color to a dynamic material instance which I'm creating inside the constructor. Is it possible to set a value to this property at the time the projectile is spawned in C++?
This is on the character class:
Perhaps there's a better way of doing this, but I'm not sure how to set the value of the projectile color property so that the MyProjectile constructor can apply it to the dynamic material instance.
Yes you need to use "DeferredSpawn" instead. That way you can initialize variables that you need to and then finish creating.
Hope that helps =)
Follow this question
Once you sign in you will be able to subscribe for any updates here