Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 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 /
avatar image
0
Question by Caps · Jul 16, 2010 at 02:20 AM · bugaddforcedirectionchangeprecision

addForce (IMPRECISION?) object changing direction after a few frames of launch...

Hi,

I've created a simple plane and a flat cylinder...

When I apply a rigidbody.AddForce to this cylinder it moves nice in the begining sliding alog the plane using the vector direction at initial launch... But then somehow a little later (a few frames) it changes direction? Seems like an unexpected influence or force makes the object move and perturb it's original direction...

Is this some bug or something?

Thanks in advance,

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 spinaljack · Jul 16, 2010 at 02:35 AM 0
Share

The object is probably just sticking due to friction. Set the material to ice to remove surface friction. If you want to slow down you can use drag ins$$anonymous$$d.

avatar image Caps · Jul 21, 2010 at 03:34 AM 0
Share

Hi Spinaljack, Thanks for the tip, even though I have played with these material setups, I still got the problem. I'll try again and see if anything changes.

Thx

6 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Waz · Jul 16, 2010 at 06:01 AM

It will almost certainly be the parameters are you passing changing. If, for example, you are passing transform.forward, then when the cylinder rolls, the "forward" rotates around to face the other way. So then it's not that AddForce is doing anything different, but rather that what you're passing is different.

So pass constant values and the direction will be constant.

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 Caps · Jul 21, 2010 at 03:32 AM 0
Share

Hi Warick, thank you for your reply.

I will check and see if the addforce is being applied to local orientation of the cylinder, as this is what I understood from your answer.

avatar image
0

Answer by Caps · Jul 23, 2010 at 03:27 AM

Hi there,

After rebuilding the whole project again I have come to the same "bug". I'm calling this a "bug" because I'm not really sure it is a bug but for sure this rather simple scene shows some awckward behavior.

So, I have tried playing with the rigidbody materials, using ice and all other as suggested...

I have also made sure that the added force only applies during one frame, that is, there are no other forces being applied after the object has been launched!

Still, incredibly, somehow the launched cylinder changes direction after a few frames, it does not move straight...

Could anyone try building this scene (simple plane, flat cylinder like a button, launch this cylinder using rigidbody.AddForce in various directions and check out after a few frames if cylinder maintains it's original launch direction vector before stopping)

Thank you.

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
0

Answer by Mike 3 · Jul 23, 2010 at 08:49 AM

Try ticking the box for freeze rotation. With the same setup you described, the cylinder rolls off in some random direction without it ticked, with it on it slid in the correct direction

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
0

Answer by Caps · Jul 27, 2010 at 02:36 PM

Hi Mike

Thank you for your answer, although that does not solve the problem.

After adding a trail renderer and an orthographic top cam, I could see that there really is something wrong with this issue. The object does curve regardless of material, mass and freeze rotation settings and the worst part is that it seems to "snap" to one of the world axis like x or z...

You can check out the video posted that shows this problem.

http://forum.unity3d.com/viewtopic.php?t=59137&highlight=addforce

If anyone would know what is happening or could help, please do.

Thank you,

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
0

Answer by Wolfram · Aug 07, 2010 at 01:07 PM

Set the BounceThreshold in Edit->Project Settings->Physics to a smaller value.

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
  • 1
  • 2
  • ›

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

Problems changing terrain editing tool. 3 Answers

add force in camera direction 1 Answer

Raycast Hit Question 1 Answer

AddForce problem 2d 1 Answer

Separating direction from force w/ rigidbody.AddForce 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