Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

how to use smooth damp angle atan2 rad2degrees and keep analog stick input sensitivity preserved?

Discussion in 'Visual Scripting' started by zeropointblack, Nov 10, 2020.

  1. zeropointblack

    zeropointblack

    Joined:
    Jun 8, 2020
    Posts:
    189
    EDIT: SOLUTION FOUND AT POST 3

    Hello, I followed the Brackeys video tutorial on third person character movement.

    im using what he said like "Quaternion Euler" "Smooth Damp Angle" "Math ATan2" "Rad2Degrees".

    it works, but does not preserve analog sensitivity input.


    So I multiplied my stick move input by the later nodes (2ND POST BELOW), which is technically working, but now it is a strange combination of normal 3rd person and tank controls. so the direction pressed is always functioning as it should, and turning my player avatar at the same time. the stick move input also appears to be working, meaning, whatever direction i press, the character is moving that way in relation to the angle the player is facing, just not physically correct in the world.

    for example:

    i press and hold back on the stick, which causes my player to face the camera, which is so far correct, but then runs away from the camera as if walking backwards. so both are working, just not together.

    EDIT EXAMPLE 2:
    if i press LEFT my player faces left, and then moves tank LEFT towards the camera. so there seems to be an issue with local versus world movement.

    if i press forward, it works perfectly, any other direction produces undesired results. move 0.png move 1.png move 2.png move 3.png move 4.png
     
    Last edited: Nov 10, 2020
  2. zeropointblack

    zeropointblack

    Joined:
    Jun 8, 2020
    Posts:
    189
    this is the current situation, which is the tank 3rd person issue mentioned above. perhaps its an issue with multiplying a vector 3 with a quaternion stuff directly?
     

    Attached Files:

  3. zeropointblack

    zeropointblack

    Joined:
    Jun 8, 2020
    Posts:
    189
    i got it! dont ask me how this works, or how i figured it out, but i got the idea to plug the magnitude as a float from my input directly into the equation, and it worked.

    i would like to leave this thread up for anyone else needing the help.
     

    Attached Files: