unity face direction of movement

transform.rotation = Quaternion.LookRotation(dir);

3.7
10
Phoenix Logan 186120 points

                                     float moveHorizontal = Input.GetAxisRaw ("Horizontal"); float moveVertical = Input.GetAxisRaw ("Vertical");   Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical); transform.rotation = Quaternion.LookRotation(movement);     transform.Translate (movement * movementSpeed * Time.deltaTime, Space.World);

3.7 (10 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
make player face direction of movement unity unity make enemy face direction rigidbody player face direction of movement unity object face direction of movement make object face direction of movement unity make player face direction of movement unity face movement direction unity face direction of movement 2d unity make character face movement direction unity face direction make camera face direction of movement unity how to make character face direction of movement unity face direction of moving unity unity rotata player towards direction is moving unity determine direction of movement unity look at move direction unity face the way you move unity make player face move direction how to make a game object face the direction it is moving unirt unity C# character rotate to where he is facing look towards movement unity object look at moving direction unity rotate to face movement direction how to make object face in direction of movement unity rotate towards move direction move character facing direction unity gameobject face direction of movement unity face moving direction unity look in direction of movement unity c# look in direction of mvoement make object face movement unity unity face direction of movement unity get movement direction with facing movement script unity character facing direction make moving sprite face the direction unity 2d unity look at direction of movement unity face direction of movement 3d unity make object face direction of travel unity face in direction of movement
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source