Hi, i have created some enemies for my game, what i wan’t is: to delete the instance from this enemy actor, but leave the static mesh componnent from this actor in the world, some kind of “detach”, i know i can do workarounds to solve this problem, i don’t need exactly to delete the actor, i could do some changes in my code, but i know leaving 200 or so actors in the world just to act as dead bodies may be some waste of hardware, deleting them is an obvious solution to this problem but still i would need to wait the player go away from it and suppose he will never go back to this place again or suppose it has been passed time enough to the point it’s acceptable that the body was taken away from there.
I think there’s no way to leave, “just the mesh”, it needs to be an actor to be part of the world. What you could do is have a different actor class for this. You could make something like an EnemyRemains actor that only has a static mesh component as root, and disable everything you won’t be needing for this, like the tick event and such, reducing the impact on performance as much as you can. Besides if this mesh, is something simple like a sphere, and it doesn’t have fancy materials (reflection and stuff), then performance shouldn’t be a problem.
“I think there’s no way to leave, ‘just the mesh’, it needs to be an actor to be part of the world.” i just disagree with this part since you can just add static/skeletal mesh to the world without any code in it as part of the scenary, so i don’t need an actor class for it.
but i will accept my sad fate, afterall sometimes the engine just don’t have the features i want
They are still actors, if you go inspect them on the detail panel, they have a transform and a root component just like any other actor. And if you add a static mesh, and you look at the type in the world outliner it says StaticMeshActor
Delete Actor Spawn Mesh