Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by VRlunatic · Oct 05, 2019 at 05:53 AM · physics2dkinematichingejoint2d

Hinge Joint 2D not working when Rigidbody is Kinematic

I'm making a 2D pinball game in which the flippers are animated with a Rigidbody 2D and Hinge Joint 2D components. All works fine when the Rigidbody is set to Dynamic, but when I change it to Kinematic, the flipper doesn't respond to input. It doesn't rotate.

I think it's better if the flippers were Kinematic as there's no need for them to calculate physics. All they need to do is provide something for the ball to bounce off of, and I think they don't need to be included in the Physics 2D calculations.

What could I be missing that's preventing the flippers from rotating when I change them to Kinematic? Any help is welcome!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by VRlunatic · Oct 06, 2019 at 11:18 AM

Also, maybe this matters: I'm using the motor function to move the flippers. Maybe they only work when the hinge joint is dynamic. How to rotate the flippers kinematically? Thanks.

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 prabhjeets · Oct 11, 2019 at 05:19 AM

I have almost the exact same problem and am unable to move the object by modifying the motor speed in script. Been banging my head against Google searches for a couple of days now with no luck. Below is my FixedUpdate method. I can see the speed being set on the motor of the hinge in the debug statement but object does not move.

     void FixedUpdate()
     {
         
         if (isKeyPress)
         {
             myMotor.motorSpeed = 1000;
             myHinge.motor = this.myMotor;
             myHinge.useMotor = true;
             Debug.Log("Motor Speed: " + myHinge.motor.motorSpeed);
         }
         else
         {
             myMotor.motorSpeed = -1000;
             myHinge.motor = myMotor;
         }
         
     }
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 VRlunatic · Oct 11, 2019 at 05:35 AM 0
Share

That's because you can only use the motor function when the rigidbody is set to dynamic. The motor function has to use physics. When you set the rigidbody to kinematic (as I want it because it's more efficient) then you cannot use the motor function for rotation but have to do it a different way, such as with transform.rotate or with a tween. I'm using a tween from DOTween which works well, as I described above. The only problem is that the ball is hit too hard, as you cannot specify the force when using kinetic simulation. I hope someone offers an answer to this. I am thinking I have to somehow dampen the physics material, I'll check out the settings when I get home.

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

187 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 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 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 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unable to AddForce on a game object containing a RigidBody2D and a HingeJoint2D? 1 Answer

2d gameobjects stuttering 0 Answers

Chain made out of 2D Hinge Joints isn't moving around, also it stretches weirdly 0 Answers

Hit from kinematic rigidbody2d 1 Answer

Hingejoint2d's connected body unaffected by joint, spinning wildly (video) 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