#This return node on spawn actor for

1 messages · Page 1 of 1 (latest)

cold fable
#

OK, but my actors arent spawned through spawn actor, they are placed in the world ahead of time manually.

covert hill
#

Im not that good at unreal but i would make a system to spawn them or you would need to sort through all objects in vicinity i guess.

#

Not really sure what the best approach is.

#

Oh actually

#

There is a "get all actors of class" node.

#

You could use that to get all of a specific enemy

cold fable
#

but then how do I differentiate between them? like if I have Bob1 and Bob2 at opposite ends of the map, but Bob1 has lost half his health, how do I assign that lost half health specifically to Bob1 on load?

covert hill
#

Even better:

#

You use this reference when saving them by going through each actor with a "for each"

#

And on load you just go through the struct list and spawn actor of that specific class and change their stats.

#

If your actor implements a component for their stats its very easy to access and change after spawning them.

#

For example here I have my generic damage system component.

cold fable
#

Ok, but lets say I have an actor that I placed at a position.
On save that actors information, including their position, is saved.
Now when I load, it spawn an actor with the correct stats at that location.
Would there not now be 2 actors stacked on top of each other? The one I placed and the one spawned with the correct stats?

covert hill
#

I can pass any actor reference to it and if that actor has the component i can deal damage to it.

#

I could do that when spawning it.

covert hill
#

I havent played around with saving myself.

#

But I remember asking about it at some point and structs were the answer I got.

cold fable
#

I'll refine my question and repost then, thanks for the help though.