Expose on spawn not visible when class from datatable

Hi
So I have projectiles I want to set the speed of during runtime when they spawn. I have created an expose on spawn speed variable.
However it is bullet hell style game where the character can have several weapons selected from a long list.
So when i create a for loop of all the weapons the char has equipped i get the weapon class from datatable based on the name.
When i spawn this way the expose on spawn variables are not visible.
What is the best way of achieving this :



TIA

You can perhaps create a struct that consists all the different attributes of your weapons, including that speed variable you want. This way you can access them from your data table

Its getting the class that i want to spawn is the issue.

I see, sorry about that. Maybe consider creating a projectile class then?

it can work if you cast the class to your base class first before connecting to the spawn actor node
That way, all properties of the base class that are exposed on spawn will show
Alternatively, if your data table struct’s class property is of your base class type, then it will also show

If each weapon has a different class, with different exposed on spawns params, you obviously can’t do this in a generic way, so you would have to somehow pass a generic payload that the receiver can interpret as they want
You can use instanced structs for that

To expand a little on what Zeaf has said, you can’t really do what you’re trying to do because the timing is wrong.

ExposeOnSpawn needs a type that is known when the blueprint is compiled. This is why your first example works. In your second example, you’re passing in a class that is only known at runtime which means that the only type information the compiler has to go on is the type of OutRowWClass as a variable and not the type it is referencing.

Yep that work. I cast it to weaponclass first and the variables appear. Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.