Referencing the rotation of a child?
Hi i'm looking for some help in referencing the rotation of a child object. I have a tank object that is made up of 2 parts, the body and the turret each with it's own rotation script. I currently have my movement script on the body and in the turret script I have it's position set to the same position as the body so they move as one however the turret jitters when moving due to the position not updating quick enough in the 'Update' function.
The reason i've done it this way is because the tank itself moves forward based on the rotation of the lower half so i put the movement script in the body child.
Here's my Parent/Child format: Tank (Empty Parent) Tank Body (Child) - Movement script, Base rotation script Tank Turret (Child) - Turret Rotation script
To fix my problem I know the easiest way is to put the movement script onto the Parent object however the problem is that I need to reference the rotation of the base somehow and i'm unsure on how to go about this? Could I make the rotation a variable and then call on it in the parent?
Here are the three scripts i'm using: https://pastebin.com/78UJ2SbB - movement script https://pastebin.com/kHtndrb8 - base rotation script https://pastebin.com/3YAuPCM8 - turret rotation script