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 Charging-Pun · Dec 11, 2014 at 10:48 AM · physicsballrespawn

How do I stop all momentum of an object?

As a follow up to this question is it possible to arrest movement of an object?

In my game where the player is a ball rolling around a surface. When the ball rolls off the table (I have a plane set up with a trigger to respawn the ball), it respawns in the right location, but it keeps all momentum from before it hit the trigger.

I have tried to set the velocity of the object to 0, but it doesn't cause the object to remain stationary until the next user input.

What can I add to my script to respawn the ball without any momentum?

Comment
Add comment · Show 3
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 meat5000 ♦ · Dec 10, 2014 at 09:18 PM 0
Share

but it doesn't seem to have the desired effect

Please elaborate

avatar image MrSoad · Dec 10, 2014 at 09:39 PM 0
Share

Have you tried setting "is$$anonymous$$inematic = true" rather than adjusting the Velocity of the ball ?

avatar image bkevelham · Dec 11, 2014 at 10:52 AM 0
Share

What is exactly the movement it still has? Does it still have an angular velocity? If so, try setting that to zero as well.

1 Reply

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

Answer by Baste · Dec 11, 2014 at 11:16 AM

If this doesn't work:

 transform.position = respawnPosition;
 rigidbody.velocity = Vector3.zero;
 rigidbody.angularVelocity = Vector3.zero;

You're adding velocity to the ball after you have moved it.

Comment
Add comment · Show 5 · 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 Charging-Pun · Dec 11, 2014 at 07:15 PM 0
Share

What is the difference between rigidbody.velocity and rigidbody.angularVelocity?

avatar image bkevelham · Dec 11, 2014 at 07:49 PM 0
Share

It's basically the rate at which an object is rotating around its axis of rotation. As the name says, it's angular. This in contrast to normal velocity. So say you hit a ball with topspin. Then it both has a velocity (how it moves) and angular velocity (how it spins).

avatar image Owen-Reynolds · Dec 11, 2014 at 08:06 PM 2
Share

It's like one of those toy cars where you yank something to rev the wheels, them put it down. You ball is like plucking up one of those moving cars and dropping it at the start of the track, with the wheels still spinning.

avatar image Charging-Pun · Dec 11, 2014 at 08:08 PM 0
Share

That definition helps immensely. That means this is likely the solution to my problem, as the ball is both moving and spinning (rolling) as it falls off the "table." I will confirm at my next opportunity.

avatar image Charging-Pun · Dec 12, 2014 at 01:42 PM 0
Share

I'd upvote you, but I don't have enough rep. Thanks for the help.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

If trigger hit, spawn it 1 Answer

Best way to achieve Sonic style physics? 0 Answers

Soccer Ball Kick Help 2 Answers

Constant force, with gravity, and correct collisions. 2 Answers

Key elements in how to make a 3d golf game 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