CharacterBody3D's z-index is adjusted when instantiating a CharacterBody3D child

Godot Version

4.3

Question

I figured a work-around solution to this but it would be nice if it weren’t necessary.

Here’s how I’m instantiating the node:
node-path = “res://main/world/molds/petal_mold/petal_mold.tscn”
var loaded_node = load(node_path)
var instantiated_node= loaded_node.instantiate()
add_child(instantiated_node)
instantiated_node.global_position.x = global_position.x + 2

The x+2 is enough distance from my instantiating CharacterBody to not have overlap, yet it does and causes the pushback.

I noticed that adding global_position.x -= 2 to the instantiating CharacterBody during this call removes the pushback, solidifying my idea that they’re overlapping even though I never see it. That, and switching the collision layer of the instantiated node removed the issue. But I’d rather not have to do that.

Have you checked with collision shapes visible ( Debug > Visible Collision Shapes ) when it’s running? I’ve accidentally misaligned the collision shape from the object in the past causing this sort of issue.

It’s not that. I forgot to mention that I’m calling this in the _input event so it may have something to do with overlap occurring before the engine has a chance to move it.

This doesn’t happen if I spawn it in my World node, and honestly, I think I want it there so I’m closing this topic.