Hey, i have a very simple question i think.
I have a joystick that gives me 1 to -1 values in horizontal and vertical and when i dont use it it returns to 0. which is to be expected but i need it to remember what it was before letting go.
public void Twist()
{
h1 = joystick.Horizontal;
v1 = joystick.Vertical;
transform.localEulerAngles = new Vector3(0f, 0f, Mathf.Atan2(h1, -v1) * 180 / Mathf.PI);
}
This script rotates my character but when i let go it points in the same direction everytime(Up)
And also this only happens when i am in water, so that when im in water it rotates to the way im pointing with my joystick but i can also go on land and i dont want it to remember what values it had for that, but i can figure that out myself since there is a lot of the script you cant see. Any help will be grately apreciated <3