Welp! Looks like I spoke too soon! The link seemed to make sense and is what I want, to adjust the time it takes to return to 0 after letting go of the stick, but it seems to have little effect on the my joystick, either that, or it’s just not reacting in the same way as the keyboard. I think I would have to write my own code as you suggested to fix the issue. I might have to move on, as I’m not sure I’m experienced enough to write the code on my own. I’m pretty sure it’s probably the rotation I’m wanting to fix.
Here is what my current code looks like:
private void ProcessTranslation()
{
xThrow = CrossPlatformInputManager.GetAxis(“Horizontal”);
yThrow = CrossPlatformInputManager.GetAxis(“Vertical”);
float xOffset = xThrow * Speed * Time.deltaTime;
float yOffset = yThrow * Speed * Time.deltaTime;
float rawXPos = transform.localPosition.x + xOffset;
float rawYPos = transform.localPosition.y + yOffset;
float clampedXPos = Mathf.Clamp(rawXPos, -xRange, xRange);
float clampedYPos = Mathf.Clamp(rawYPos, -yRange, yRange);
transform.localPosition = new Vector3(clampedXPos, clampedYPos, transform.localPosition.z);
}
}
private void ProcessRotation()
{
float pitchDueToPosition = transform.localPosition.y * positionPitchFactor;
float pitchDueToControlThrow = yThrow * controlPitchFactor;
float pitch = pitchDueToPosition + pitchDueToControlThrow;
float yaw = transform.localPosition.x * positionYawFactor;
float roll = xThrow * controlRollFactor;
transform.localRotation = Quaternion.Euler(pitch, yaw, roll);
}