Issue with child node objects respawning in the wrong position

Hello everyone.

Today, I wanted to test the required configuration for my project. When using a GTX 1060 GPU, the frame rate during debug testing was quite unstable.

It seems to be caused by having too many objects (GameObjects) in the same scene. Reducing the number of objects improves the frame rate.

So, I decided to use the built-in BaseSettings node to create a performance optimization method. For example:

With this simple setup, we can achieve performance optimization by spawning objects when the camera approaches them and deleting them once the camera moves away.

However, at the same time, I discovered that if a respawned object is a child node, it does not respawn at its original birth position.

The position is shifted. All child node objects fail to respawn at their initial spawn points.

Here’s an example:

image

Objects A and B spawn at this location. Even if they disappear, they will respawn at the same position.

But if:

image

I place B inside a child node, and I move the player there initially, it still appears as shown above.

However, if I leave the scene and return (i.e., delete and respawn), B’s position is no longer correct.

After some investigation, it seems that respawned objects are being moved to the parent node’s position. This is strange.

For example, I have some objects that rely on their parent for movement. None of them can maintain their position on the moving parent after respawning.

Parent node (moves left and right)

Child node (Object A)

Object A also fails to respawn at its birth position. After respawning, it no longer moves.

Whether I use camera-based respawning or action-based respawning, I cannot make objects respawn at their initial positions.

I find this unreasonable. Is this a bug, or am I misunderstanding how it works?

Your guidance would be greatly appreciated. Thank you very much.

Great info, I will pass this along.

For workaround purposes, is there a reason you need them as a child? Is it maybe for organizational purposes or for mechanically reasons?

Mechanism considerations,

For example, if I have some objects that are fixed and do not move, I only need to place the object itself.

However, occasionally I need a few identical objects to move to different locations. The most convenient method is to append an empty object to its node to serve as the mover, and then place the fixed object as its child. This is very convenient.

But I didn’t expect to be tripped up by the issue of incorrect respawn positions :downcast_face_with_sweat:

1 Like