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.

Question How do I make my character move in the direction they are looking

Discussion in 'Visual Scripting' started by fiesinator, Mar 14, 2023.

  1. fiesinator


    Oct 17, 2020
    Basically title. I want to make a tank like control scheme for a player but cant define the direction it is looking at. When I use Character controller the rest of the movement from my character doesnt work anymore so I would like to do it with set velocity or force if thats possible.
  2. vintage-retro-indie_78


    Mar 4, 2023
    you need to calculate the forward-looking vector, one can do that based on rotation . . .

    Screenshot (5224).png

    then, just add that to the current position every frame, or use it for the velocity vector . . .

    Screenshot (5225).png

    the math to calculate the forward-movement vector is bit tricky, you need the cosine, and sine value, those are how to then make a forward-moving vector . . . . :) :eek: