![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | ravend |
Why does the projectile inherit the rotation of the turret?
main.tscn:
extends Node3D
func _physics_process(delta):
$Turret.rotate(Vector3.FORWARD, 0.01)
turret.tscn:
extends CSGBox3D
var shell_res: PackedScene = preload("res://shell.tscn")
func _input(event):
if Input.is_action_pressed("m_left"):
var shell = shell_res.instantiate()
shell.apply_central_impulse(global_transform.basis.x)
add_child(shell)
shell.tscn:
extends RigidBody3D