Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
1
Question by Xanthos · Mar 10, 2014 at 09:16 PM · animationrotationvelocitynavmeshagent

Increase NavMesh Rotation Speed

1.)I am utilizing an animation controller and navmesh agent. The Animation controller simply plays a walking forward animation and the navmesh agent controls the rotation of the agent.

I have tried changing the angular speed of the agent and nothing has changed.

I am looking for a way to make my agent's rotation speed faster so they can navigate around corners quicker. The angular speed did nothing when I changed it.

2.)On a side note I have used two different kinds of animations, one which displaces the animator and one which animates them without any changing their placement in any way.

Is there a way to stop an animation from changing the velocity of my actor?

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
9

Answer by Carnivorous · Mar 01, 2017 at 02:56 PM

This solved the problem for me. Call the extraRotationSpeed once in every Update().

    float extraRotationSpeed;
     
     void extraRotation()
         {
             Vector3 lookrotation = agent.steeringTarget-transform.position;
             transform.rotation = Quaternion.Slerp(transform.rotation,Quaternion.LookRotation(lookrotation), extraRotationSpeed*Time.deltaTime);
     
         }
 void Update()
 {
 extraRotation();
 }

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 potatoman_5000 · Oct 13, 2021 at 02:09 PM 0
Share

when the agent reaches the target it turns to face to the players starting rotation, how can i fix

avatar image
4

Answer by brunopava · Jul 10, 2014 at 01:16 PM

Hi, I had the same problem once. But looking at the API reference I discovered that angularSpeed receives influence from both speed and acceleration. So I played around and found that if you increase acceleration you can reach the desired rotation speed that you want.

My current configuration is:

Speed 7

Acceleration 10

Angular Speed 999 (dunno if a high number is valid here, but hey it works)

Comment
Add comment · 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
2

Answer by lex24 · Aug 19, 2014 at 11:48 AM

1) NavMeshAgent actual turn speed is faster if its velocity is small. In my project I'm simulating car traffic in a city and I need my car to turn faster on road crossings.

To solve this problem I'm using this:

 void changeSpeed()
 {
         float speedMultiplyer = 1.0f - 0.9f*Vector3.Angle(transform.forward, agent.steeringTarget-transform.position)/180.0f;
         agent.speed = moveSpeed*speedMultiplyer;
 }
 void Update()
 {
        changeSpeed();
 }
 void Start () {
         agent = gameObject.GetComponent("NavMeshAgent") as NavMeshAgent;
 }

For this to work correctly agent.acceleration value must be near or greater than agent.speed value

2) remove "Apply Root Motion" checkmark from Animator component of your actor, or set Animator.applyRootMotion to FALSE when needed by script if you need to disable root motion only for some animations.

Comment
Add comment · 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

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

24 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I access the "Average Velocity" of a run animation? 1 Answer

set child object position when playing the animation 0 Answers

Override animation in LateUpdate() 0 Answers

Model stays at the end of my animation D:? 0 Answers

Do animation rotations refuse to accept negative values? 2 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