#3D Projectile not spawning in correct place

4 messages · Page 1 of 1 (latest)

analog dock
#

Hi, I have been having an issue where projectiles are not rotating correctly with my player & weapon, and are trailing behind when the players velocity is increased.

Only related question I could find online (unanswered): https://godotforums.org/d/30716-projectiles-spawn-away-from-muzzle
GitHub for the project: https://github.com/KermitGodFrog/Lunar-Front

The player rotates with rotate_object_local(), which might relate to the strange rotation of the projectile when spawned.
The weapon rotates with look_at().

So far I've tried:

  • Orthonormalizing the player, weapon and projectile instance.
  • Messing around with whether the projectile instance uses local or global transforms of the weapons spawn marker.

Any ideas on how to fix this are greatly appreciated.

formal lintel
#

Idk if that makes a difference but you could try adding the child immediately after instantiating and set the transform afterwards

magic obsidian
#

As codimon said: add child first then set the transform

analog dock
#

alright; will try