public class CharacterMove: MonoBehaviour
{
Rigidbody rb;
P_Input p_input;
[SerializeField] float speed;
[SerializeField] float rotationSpeedForPad = 5f;
private void Awake()
{
rb = GetComponent<Rigidbody>();
p_input = GetComponent<P_Input>();
}
void FixedUpdate()
{
PadRotate();
}
void PadRotate()
{
float rotation = p_input.rotationAxisX * rotationSpeedForPad;
Quaternion deltaRotation = Quaternion.Euler(0f, rotation, 0f);
rb.MoveRotation(rb.rotation * deltaRotation);
}
}
public class CharacterMove: MonoBehaviour
{
Rigidbody rb;
P_Input p_input;
[SerializeField] float speed;
[SerializeField] float rotationSpeedForPad = 5f;
private void Awake()
{
rb = GetComponent<Rigidbody>();
p_input = GetComponent<P_Input>();
}
void FixedUpdate()
{
PadRotate();
}
void PadRotate()
{
float rotation = p_input.rotationAxisX * rotationSpeedForPad;
Quaternion deltaRotation = Quaternion.Euler(0f, rotation, 0f);
rb.MoveRotation(rb.rotation * deltaRotation);
}
}