Grogger
(Grogger)
June 7, 2016, 3:33pm
5
Another approach is to keep some state for what you WANT the instance to be. For example, if the dynamic instances are some kind of firearm, then you save member variables that say “Walther PPK” or “M249 SAW” or whatever. Then, the way that the instance gets created in your code, is that your code notices that the “right” sub-actor isn’t attached, and removes the wrong one (if present) and creates/attaches the right one. Run this code when entering the world, and it will be in the right configuration once the player can see it.
If the sub-actors in turn have their own save data, this won’t work straight up, unless they store their sub-data (ammo count, etc?) in the player/playercontroller.
Thanks for the suggestion jwatte, though this won’t work for us. We have a data driven setup where an actor can have any amount of data components at any given time, so the solution we’re looking for would ideally be non actor specific