Unity mobile joystick problems
Hello, I am creating a mobile top down shooter with Unity and my problem is that aiming with the joystick feels very stagnant. It's like the joystick knows about 100 different directions, but I need 1000. I hope this is somewhat understandable what I mean. The joystick just doesn't feel smooth. Is there any way to change this? Something like increasing a sampling rate so that the screen on the smartphone detects even the smallest changes? For the joystick I use the following asset:
https://assetstore.unity.com/packages/tools/input-management/joystick-pack-107631
The implementation of my rotation and trying to make it smooth looks like this:
float eulerY = (Mathf.Atan2(_JoystickShoot.Direction.x, _JoystickShoot.Direction.y) * 180 / Mathf.PI);
if(_LastJoystickShootEulerY == 0.0f || Mathf.DeltaAngle(eulerY, _LastJoystickShootEulerY) > 30)
_Weapon.GetBarrelContainer().transform.rotation = Quaternion.Euler(0, eulerY, 0);
else
_Weapon.GetBarrelContainer().transform.rotation = Quaternion.Lerp(Quaternion.Euler(0,_LastJoystickShootEulerY, 0), Quaternion.Euler(0, eulerY, 0), 0.5f);
_LastJoystickShootEulerY = eulerY;
Your answer

Follow this Question
Related Questions
C# 3D Collider Without Fixed Points or use Mesh Filter Instead? 0 Answers
Advanced Wave Spawner 1 Answer
How to implement the ability to move and place objects in HoloLens Application? 0 Answers
Checking if GameObject is withing an other GameObject? 0 Answers
How to use 3D colliders and rigidbody on 2D character controller 0 Answers