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
0
Question by ActionScripter · Jun 01, 2012 at 03:54 PM · rotationphysicsrigidbodyrotateglitch

Rigidbodies misbehaving when another is rotated

I have a scene with some simple physics stuff. There's a big ball on a long ramp, as well as a pedestal-mounted launcher nearby that shoots small balls based on its current orientation.

125Physics setup125

This setup normally works fine, but when I made the launcher's azimuth adjustable by keyboard, weird things began happening.

If the launcher is aimed forward and tilted up (45 degrees in elevation, 0 otherwise), the scene performs fine. The big ball rolls down the long ramp in the background, and the launcher fires small balls on demand, which bounce along in a reasonable path. However, as soon as the launcher is rotated (slewed) to an azimuth of about -60 degrees, the big ball suddenly SHOOTS sideways/backwards off the ramp. It then hits an invisible wall in midair, causing it to fall almost straight down, then it lands and rolls forward and sideways. There is nothing there for the ball to hit in midair, and there are no surface features on the ramp, so this is quite perplexing.

Also, the small balls from the launcher will now (seemingly at random) fire out at an incorrect angle... the launcher will be aimed a bit left and they'll fly to the right instead, as if there's a wind blowing. As soon as the angle is tweaked or even the camera is moved, the next balls resume proper trajectory.

What on earth could be causing these anomalies? As far as I know, I have not tied the big ball to the launcher in any way, and the launched balls' trajectories should always be in the direction of the launcher. Perhaps there's some inherent flaw in the physics engine? "I just don't know what went wrong."

Info: The big ball and ramp are standard primitive rigidbodies with colliders (sphere and box respectively). Also, the scene uses a smaller physics time step, smaller penalty distance, and larger angular velocity limit than default because the balls won't collide/roll properly otherwise. Here is the relevant code for the launcher (attached to the nozzle piece that actually aims):

 if(launchNow){
     launchNow = false;
     // FIYAH!
     var newBall = Instantiate(projectile, transform.position + spawnDistance * transform.forward, transform.rotation);
     var rb = newBall.GetComponentInChildren(Rigidbody);
     rb.AddForce(transform.forward * force);
     
 }


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

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

add force to rotation 1 Answer

Rotating a Rigidbody with Physics 1 Answer

How may I observe expected physical interactions while using Rigidbody.MoveRotation()? 1 Answer

Freezing Rotation and Joints (Swing / Rope) Physics Issues 1 Answer

drag object including free rotation 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