[Closed] Respawning an actor (Spawn actor after Destroy)
Lets say I pick up a sword on the ground called ASword. To remove it from the world I could call Destroy on ASword but that would prevent me from being able to re-spawn it into the world. I tried to call RemoveActor from UWorld but that did nothing.
What is the proper way to "Re-Spawn" an actor?
Below is my current implementation: This is how I add an item to my inventory, It gets called when NotifyActorBeginOverlap() is called by the item (a sword in this case). I first check to make sure it was successfully added to the inventory before destroying/removing the item.
In my inventory, I have the option to right click an item and drop it. In other words this will remove the item from the inventory and then attempt to re-spawn it into the world. Here is what the code looks like for that:
When Attempting to drop the item, nothing happens and I get a warning saying "SpawnActor failed because the spawned actor IsPendingKill".
So what Is the proper way to do this?
asked Feb 02 '16 at 02:13 PM in C++ Programming
The question has been closed Feb 02 '16 at 08:11 PM by Doug E for the following reason:
I noticed that you posted the same question here:
I will be closing this post so that discussion of this issue can remain in one place and make it easier to find information about this in the future.
answered Feb 02 '16 at 08:11 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here