Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ravend |
I am making a turret.
All nodes with their scenes:
-Turret(Node3D/CSGBox3D - turret.tscn)
-Gun(Node3D/CSGBox3D - gun.tscn)
-Bullet(RigidBody3D - bullet.tscn)
Gun:
var bullet_res: PackedScene = preload("res://bullet.tscn")
func fire() -> void:
var bullet = bullet_res.instantiate()
bullet.apply_central_impulse(global_transform.basis.x * 10)
add_child(bullet)
A bullet flies when firing. Everything is fine.
But if I turn the tower:
Turret:
func _process(delta):
rotate(Vector3.UP, 0)
The bullets do not fly.
Why does Turret.rotate affect the bullet.apply_ central_ impulse ?