I’m learning Unreal, And having watched a bunch of tutorials and making basic Systems i was working with Currency. Currently i have a Actor that when it’s destroyed. Increases a counter by 1. But Say i wanted 5 Different Counters to be tracked, But the Difference between the Destroyed actor is a Material? So if i have, Red, Blue, Green. All on the same actor. Could i count them independently or would i have to use Different actors?
On What i am doing, I have a Function with a weighted chance to spawn a Breakable Rock. Math all works there but here at the end in my Construction Script i Have this.
Gets the Weight out of the Construction Script, One of 5 Rock types will spawn and the Actual Rock Material is given there. I want to be able to add to this here based on which Rock i broke based on it’s material.
Currently i just have this, Which i know i could Replicate and do in different ways if i was targeting different actors. However i am unsure how i could approach this if i was using materials?
If anything is broken currently it just adds to the Coal counter which i understand it’s how i’ve done that and get it.
I would advice you to put type-of-rock enum or int in the actor itself and make both the material and the counter depend on that instead.
It is not impossible to make it based on material but it creates an unnecessary dependency and might not work on dedicated server. (servers don’t render and might not have access to the materials at all, although this is a speculation)