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 Ukyo · Nov 17, 2010 at 11:01 AM · physicssteeringunitysteer

Unitysteer - Rigidbody with gravity stops steering

When I have rigidbody with gravity enabled on the object being steered. after about a moment of movement, it comes to a stop. I disable gravity, and it works fine. If I change the mass in rigidbody, it goes further. Is there any way to remove mass from the movement calculation?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Ricardo · Nov 17, 2010 at 11:27 AM

Hello Jon,

As denewbie points out, if the character has a rigidbody, then AutonomousVehicle's behavior will be affected by physics.

You have several options:

  1. Reduce the rigidbody's mass.
  2. Increase the force being applied to the object.
  3. Alter AutonomousVehicle.ApplySteeringForce and not take Mass into account.

You could even create a simpler vehicle if the considerations taken by AutonomousVehicle are too elaborate for the effect you're trying to achieve.

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
1

Answer by denewbie · Nov 17, 2010 at 11:21 AM

The reason why it stops is because of friction with the ground. The object looses energy due to that friction and slows down until it comes to a complete stop. Reducing the mass will only delay the stop time. What I ll suggest is to

1) add a force to the object and change it based on the rigid body's velocity

So you could try something like this:

(This is in C#)

float maxVelocity = 10f; float myForceSize = 0f public float variator = 0.1; public Vector3 initVel = Vector3.forward * 10f; // Set the initial velocity of the object

funtion Start(){ rigidbody.velocity = initVel; }

function FixedUpdate () { if (maxVelocity < rigidbody.velocity.magnitude ) // When speed is too fast myForceSize -= variator; else if (maxVelocity > rigidbody.velocity.magnitude) // When speed is too slow myForceSize += variator; else // When speed is just nice myForceSize = 0f;

 rigidbody.AddForce (Vector3.up * myForceSize);

}

2) Directly change to velocity per fixed update (Not recommended tough)

rigidbody.velocity = myVel; // Where myVel is a Vector3

3) You can try moving the object via Translation : myBody.transform.Translate(Vector3.forward * mySpeed);

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

No one has followed this question yet.

Related Questions

Combining Seek and Flee steering forces causing problems 0 Answers

Help with kinematic NPCs following non-Kinematic player and avoiding obstacles 0 Answers

Problem employing movement behaviour using a flow-field table 0 Answers

Lock On Projectile 4 Answers

Robot Simulation 1 Answer


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