So I followed the lesson and changing from basis.z to global_transform.basis.z did nothing to help the shot being off.
- extends Node3D
- @export var projectile: PackedScene
- var enemy_path: Path3D
- @onready var turret_top: MeshInstance3D = $TurretBase/TurretTop
- func _physics_process(_delta: float) → void:
- var enemy = enemy_path.get_children().back()
- look_at(enemy.global_position, Vector3.UP, true)
- func _on_shot_timer_timeout() → void:
- var shot = projectile.instantiate()
- add_child(shot)
- shot.global_position = turret_top.global_position
- shot.direction = global_transform.basis.z
just a heads up using 4.2.1
saw another post about this same lesson but instead of using the basis they used direction_to tried that shot is still off.
git repo is here https://github.com/matruim/godot-games/tree/main/BarbarianBlaster