node won't follow its parent

godot 4

I’m trying to a sprite that can fire projectiles. the projectiles will project fine from the sprite and adapt its transform and move off. but when I set the firing point using a node and tell them to adapt its transform they just fire from its transform that it had when the scene was first initiated. any help would be appreciated. btw here’s my scene tree and the code that spawns the projectiles
Screenshot 2024-09-30 at 3.22.59 PM
Screenshot 2024-09-30 at 3.23.06 PM

Sorry, i’m unclear on the problem. Also, do you have code showing an action?

i’ve had a lot of problems like this and the best thing i’ve done is print the coordinates.

print("torpedo position=%s, global=%s, local=%s" % \
    [t.position, t.global_position,to_local(t.global_position)])

In my case the problem was often that the object was firing from a position that was in the parent’s local coordinate space rather than the game’s global coordinate space. So my torpedo would fire but it would start off screen in the top corner or something. i had to play with that a lot.

In another case i had top_level=true which was awesome in that the health bar above their head didn’t rotate but it meant it didn’t move with the object and i had to move it manually in _process().

But these things are hard to solve without data. You probably want to print off/debug the coordinates and coordinate system.

If you can show snippets of the code that would be helpful to pin point where the problem is.

Instead of firing the projectiles from the sprite, use a mark2d node and use the mark2d node position to mark where you want the projectiles to spawn from.