Hello, I trying to make space ship turret and need some help. What i have so far:
func track_enemy(_entity, delta):
var t = turret_parent.get_global_transform()
var lookDir = _entity.get_global_transform().origin# - t.origin
var rotTransform = t.looking_at(lookDir, Vector3(0,1,0))
var thisRotation = Quat(t.basis).slerp(rotTransform.basis, value)
value += delta
if value >1:
value = 1
here is the player and white 'thing' on top of it is turret tower looking at the target (red line how it should be).
Any help what should I do to lock rotation just on y axis?
(I can't see posted images here is hierarchy image and space ship image)