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 /
This question was closed May 28, 2014 at 11:24 PM by meat5000 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by DylanWilson · May 28, 2014 at 09:01 PM · physicsrigidbodycollidergravityforce

Gravity is preventing object from moving straight toward its direction when calling rigidbody.AddForce...

When gravity is enabled, the cube, which contains a rigidbody and a box collider, will not move precisely toward its direction when using rigidbody.AddForce. I have also tried changing the velocity directly to move the object, but it didn't change anything.

What are the reasons to why when gravity is disabled, it will go straight? What can we do to resolve it without having to disable gravity?

Here is the link to my script, which is C#: http://pastebin.com/Kpge7vSe

Comment
Add comment · Show 2
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 rockyourteeth · May 28, 2014 at 09:05 PM 1
Share

preventing it from NOT going straight? or preventing it from going straight?

avatar image DylanWilson · May 28, 2014 at 09:05 PM 0
Share

Whoops! Haha, I apologize for that. I meant, "preventing it from going straight". :)

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by Kiwasi · May 28, 2014 at 09:27 PM

Physics 101: Objects under gravity don't move in straight lines, they follow a parabola.

If you want an object to move in a straight line disable gravity. You could also add a lift force that is equal and opposite to gravity.

If you want accurate physics behaviour with you are going to have to deal with non straight lines. Physics simulation is not about making something go where you want, its about where something would go under real life conditions.

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 DylanWilson · May 28, 2014 at 11:14 PM 0
Share

Thank you.

Follow this Question

Answers Answers and Comments

22 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

Related Questions

How to make a object jump constantly at y and move to the next position to z (perfectly) 0 Answers

Tossing an object with the correct force at any distance from another so that it collides with the other 1 Answer

Tornado throwing back force after pulling 1 Answer

Artificial Gravity 2 Answers

Rigidbodies getting stuck in non moving objects 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