Hey i'm new to scripting in unity and I'm stuck at using unity's look at function and keeping an objects parent y rotation.i have 2 cylinders and my script works fine on them on individually, but together it messes up. i understand that why it doesnt keep its parents y rotation but i dont know how to fix it.is there some way i can have the y rotation in a variable and use it for the y of the x motor?my script:https://pastebin.com/cdU3FHDL
>>657628Have a look at 'Quaternion.LookRotation' in the scripting API. Working with rotations is much easier that way. To limit the turrets time to acquire targets you also wanna make good use 'Quaternion.Lerp'.For a turret you want one joint for elevation (as in gun barrel) parented to one joint for traversal (turret baseplate).Then the pseudocode to make the turret aim at a target would be something like turretRotation = Quaternion.LookRotation(targetVector, tankUpDirection);gunRotation = Quaternion.LookRotation(targetVector, turretsRightDirection);
Can you elaborate on what to are trying to do exactly?
>>657696>What toWhat you*