I want to rotate one object around another, so that it matches my current joystick rotation. I know Transform.RotateAround
does this but I can't seem to find a way to match it with my joystick rotation.
This is my code so far:
void Update()
{
joystick = InputManager.ActiveDevice;
moveInput= joystick.RightStickX;
if(currentState != CoreplayerState.stager) {
RotateChar();
}
}
public void RotateChar() {
transform.RotateAround(target.position, zAxis, moveInput * rotateSpeed);
transform.rotation = target.rotation;
}