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
3
Question by CodeBunny · Aug 17, 2013 at 05:16 PM · physicsrigidbodyvelocitykinematic

Set velocity of kinematic rigidbody appropriately

So I'm moving kinematic rigidbodies via scripting and I want their velocity to be set appropriately as they move. Right now, if they touch other physics objects, they should influence them after touching/give them momentum, but I can't get it to work.

When I try to set the velocity value in the script that moves the object, I get the following error:

 Actor::setLinearVelocity: Actor must be (non-kinematic) dynamic!

Which seems to be a PhysX error, but also kind of bullshit, since the only other understandable solution to this issue (kinematic rigidbodies automatically adjust their velocity with changes in position) doesn't seem to be the case.

I can think of other ways to get around this issue, but by far the BEST solution would be to just have the rigidbody's velocity value work correctly.

How can I get this to work?

Comment
Add comment · Show 1
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 DavidSWu · Apr 22, 2017 at 09:34 PM 0
Share

I have been trying to accomplish something similar.

The traditional definition of kinematic is an object with a inverse inertia tensor of 0 (i.e. infinite mass). This is fairly easy to implement in a physics solver, and velocity can be trivially taken into account.

Emulating it with a very heavy object whose position and velocity are set in fixed update should be a possibility, but for me this seems to kill performance.

$$anonymous$$ Wu

1 Reply

· Add your reply
  • Sort: 
avatar image
4

Answer by JoaquinRD · Aug 17, 2013 at 05:21 PM

Kinematic rigidbodies are unaffected by physics, so they cannot have a velocity because that is in the realm of physics. Use transform.Translate instead.

Comment
Add comment · Show 2 · 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 CodeBunny · Aug 17, 2013 at 09:49 PM -1
Share

$$anonymous$$inematic rigidbodies can collide with physics objects/stop their collisions, no? That's not exactly true that they're unaffected by physics. Since they can affect other things, using their velocity to apply impulses seems to be an obvious use of is$$anonymous$$inematic to me.

avatar image aldonaletto · Aug 17, 2013 at 10:49 PM 1
Share

$$anonymous$$inematic rigidbodies are unaffected by physics. Actually, a kinematic rigidbody is taken into account by the collision system only for limited purposes: it can wake up a sleeping rigidbody on collision, and can make a moving trigger work fine.

If you move a simple object (without a rigidbody) by altering its position, its collider passes through sleeping rigidbodies; if it has a kinematic rigidbody, however, the sleeping rigidbody wakes up and reacts to the penetrating collider with the penalty force - this isn't a regular collision, where both rigidbodies have their velocities altered: the kinematic one isn't affected.

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

18 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

Related Questions

Problem Trying to Apply Non-Kinematic Velocity to Rigidbody 0 Answers

how to create Magnetic repulsion ? 0 Answers

Hooking RigidBody.AddForce 0 Answers

Performance Question on Kinematic Rigidbodies 1 Answer

Rigidbody and Parenting - Kinematic Rigidbodies? 2 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