I’m extremely new to coding and I’m struggling to wrap my head around some code I’m writing. I’ve basically got an RPM meter that is responding to an RPM variable. I’ve got the RPM needle, with a child right in the centre of it that it rotates around.
This code gets it to rotate around the child fine, but it keeps rotating - it won’t stop spinning around the pivot point, just goes quicker or slower dependent on the revs:
transform.RotateAround(centerP.transform.position, Vector3.up, rpmS/50);
This code does the opposite - it doesn’t rotate around the child at all, but around the gameObject’s pivot point. It does however rotate back and forth with the revs variable:
transform.rotation = Quaternion.Euler(0, rpmS/50, 0);
I’m trying to combine the two, but it’s driving me mad - any advice?
Thanks