Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Damienthorn · May 28, 2010 at 11:14 AM · physicsaddforcedragjointweight

Help with AddForce + dragging objects

Hi!

I'll give you an example of my problem:

I have 2 cubes with rigidbodys. I use AddForce in cube n1 to control it. When I attach cube n2, the extra weight will affect the direction/velocity. This is my objective.

By attaching both of them with a joint I achieved that objective. The problem is that they are not securelly connected, i.e., they "wobble" as if they are connected by a spring.

The effect I wanted is that of a magnet, but with the added effect of the weight dragging of cube n2.

How can it be done?

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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by spinaljack · May 28, 2010 at 11:22 AM

You can parent the 2nd object to the first and then alter the weight and centre of mass with scripts.

http://unity3d.com/support/documentation/ScriptReference/Rigidbody-centerOfMass.html

After moving the centre of mass you need adjust the position where you apply force because by default, AddForce applies force at the centre of mass.

http://unity3d.com/support/documentation/ScriptReference/Rigidbody.AddForceAtPosition.html

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 Damienthorn · May 28, 2010 at 03:08 PM 0
Share

Thanks for the reply.

I tried parenting cube n2 to cube n1 and changing the center of mass of n1's rigidbody, but that didn't do nothing. By parenting, when I add force to n1's rigidbody, both cubes move as one and there is no dragging of n2.

avatar image spinaljack · May 28, 2010 at 05:25 PM 0
Share

You need to use Add Force at the original position (default is at the centre of mass)

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

No one has followed this question yet.

Related Questions

Ball physics help 2 Answers

Realistic methods of propulsion without friction involved 0 Answers

Falling object, change its angle 0 Answers

Position synchronization problem in RPC Network System 0 Answers

How can I convert velocity/direction to Force? 3 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