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 anteevy · Oct 01, 2013 at 02:13 PM · physicsrigidbodycontrolsballslowdown

Player-controlled rigidbody ball sometimes slowing down for no reason

Hi there,

I've got a rigidbody sphere that is controlled by the player. I've finally perfected the movement, but occasionally (every other minute) the ball is moving slower for 10-20sec and I can't figure out why. I monitor the rigidbody's velocity (not angular) and it drops to maybe 2/3 of the normal speed. That is a huge problem, because a lot of the traps in my game can only be passed with the right timing and full speed. I'm multiplying the applied force by Time.deltaTime. There don't seem to be any framerate issues though, it runs at a constant 60fps. Things/parameters I've experimented with without success:

  • the sphere's rigidbody parameters (mass, damping, extrapolation, ...)

  • global physic parameters (max angular velocity, ...)

  • physics material applied to sphere (friction, bouncyness, ...)

  • AddForce vs AddTorque (I think I did not see the problem with addTorque, but I can't get the ball rolling fast enough with this method only and maybe it was just a coincidence)

  • Update() vs FixedUpdate()

Even with a default rigidbody sphere and standard movement script (addforce based on horizontal/vertical input axis) I'm getting this. Has anybody got any idea why this happens? Thanks!

Comment
Add comment · Show 5
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 robertbu · Oct 01, 2013 at 03:28 PM 0
Share

Probably would need a simple demonstration script in order to figure things out. You can hack in a solution by directly manipulating Rigidbody.velocity.

avatar image Ranger-Ori · Oct 01, 2013 at 04:46 PM 0
Share

In what direction do you add the force? maybe the direction is changing downwards and therefore decreasing the velocity?

avatar image anteevy · Oct 02, 2013 at 09:38 AM 0
Share

Thanks, I'll try to directly modify the velocity vector. Somehow I always thought that one should not be messed with... :D First tests seem to work, although it is harder to get the perfect controls here (either the acceleration is too fast or too slow). I'll report back.

The force direction does not change, I checked it.

avatar image Ranger-Ori · Oct 02, 2013 at 11:50 AM 0
Share

Does the surface has any angle? are the values changing from some reason?

avatar image anteevy · Oct 04, 2013 at 04:00 PM 0
Share

Nope, clean surface and completely random. I think I've fixed it by manually adjusting the velocity vector and limiting it at length 4. I hope it stays that way, because random bugs are evil.

This randomness even extended to the OnTrigger methods that check for collision with the ball. Sometimes they are simply called more frequently than normal (which results in ground traps draining much more damage than intended). $$anonymous$$y workaround is a ray from the ball downwards to check if it is above a ground trap ins$$anonymous$$d of using the triggers. This at least seems to work all the time (and maybe is the better solution anyway).

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

15 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

Related Questions

How could I make a bouncy object move mostly along the Z axis? 1 Answer

Flick ball in 3D 0 Answers

Move a rigidbody connected with hinge joints 1 Answer

Ball physics help 2 Answers

is there a way to move a rigidbody with something like moveposition without clipping through collider? 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