how to rotate the tank turrent and shoot at enemies?

Hello, I am currently doing a project which is about tank game. The problem I encounter is I don’t know how to rotate the tank turrent by first-person controller. Also, how to shoot at enemies and the bullet can trace the enemies? Please provide codes for reference.

Make tank as prefub, put here 2 gameobjects,

first body, second turret, in turret make gameobject gun,

make gun look at z, learn about LookAt command in doco.

then it’s forward would be an axis to shoot, then use raycat for check if you hit other tank.

For rotation turret over Y coord, rotate turret,

for rotate gun at angle - rotate gun… and it’s all…

sorry for my english. It’s the easy way to make a tank…