How to rotate on multiple (two) pivots to point to an object

Godot Version

4.3

Question

Hi, I designed a simple gun turret which has two rotating pivots. The question is how to make the barrel point to another object (let’s say a flying enemy) in the space by rotating on these two separate pivots in script?

Thanks!

You are getting deep into math-terretory.
Here are two links which could point you in the right direction.

1 Like