Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
11 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by Quis · Jul 23, 2015 at 10:09 PM · rotationnavigationinstantly

Navigation agent to rotate instantly

Hello,

I am trying to figure out how to increase the speed of NavMeshAgent rotation to being instant, so that the Agent would ALWAYS face the direction that he is moving.

For example if I click just 1unit away towards the objects back, then it would turn 180degrees instantly the moment he start moving. Changing the default values did not help as it would never rotate fast enough even with values of 999999 on angular speed and acceleration.

Thanks for help :)

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image smallbit · Jul 24, 2015 at 03:20 AM 0
Share

If I remember correctly the rotation is actually faster with lower acceleration, give it a try. Or try to override the rotation editing transform component (lookAt). but I've never done it so cannot tell if this will work.

3 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by C_R_E_A_T_R_O_R · Sep 11, 2016 at 06:58 PM

@Quis

I had the same problem with a very fast agent i was using. In order to make it work exactly as you want you should set the Angular Speed to 900 - 999 and make sure that the Acceleration is a little bit higher than the Speed (eg: Speed = 14, Acceleration = 17)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mbrindic · Jul 28, 2017 at 01:06 PM 0
Share

Omg, you're right man! I spent hours on this... But finally I realize that angular speed is calculated based on both speed and acceleration!

avatar image
0

Answer by unity_w38HsBtci_B3xQ · Mar 01, 2021 at 03:28 PM

Set the Angular Speed and the Acceleration to infinity.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image GerPronouncedGrr · Aug 28, 2021 at 01:12 AM 1
Share

Doing this not only doesn't work, it will actually throw an exception.

avatar image rage_co GerPronouncedGrr · Aug 28, 2021 at 02:31 PM 0
Share

By infinity, i think they mean a very high value

avatar image GerPronouncedGrr rage_co · Aug 28, 2021 at 03:17 PM 0
Share

Even if that's the case, setting the value of these fields to a value that's too high (such that the value is displayed as an exponent) also throws an error. Anyway, even if you set the values to 99999, you won't be able to notice a difference between than and setting it to 5000, because the underlying functionality remains the same.

avatar image
0

Answer by ibon97 · 14 hours ago

         g.transform.eulerAngles = new Vector3(0,Quaternion.LookRotation(nav.velocity-Vector3.zero).eulerAngles.y,0);

esto me ayudo a mi nav es el nav mesh agent.

this helped me my nav is the nav mesh agent.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ibon97 · 14 hours ago 0
Share

put this condition behind so it doesn't bug and look at the camera

poned esta condicion detras para que no se buge y mire a camara

a y usadlo junto a un valor alto de acceleracion y velocidad de angulo

a and use it together with a high value of acceleration and speed angle

if (nav.velocity != Vector3.zero)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why Is My Enemy Rotating On X? 0 Answers

Nav Mesh Agent radius next to my game object causing a deviation. 0 Answers

3D Top Down shooter mouse follow inaccurate at some angles 0 Answers

Tilt object based on movement and direction 1 Answer

Rotate Rigidbody towards target rotation using AddTorque() 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges