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
0
Question by daviddickball · Nov 28, 2015 at 10:48 PM · addrelativeforceaddforceatposition

How do I add a relative force to the bottom of a cube?

Hi, I'm moving a cube and need to add a relative force, but it needs to be applied to the bottom of the cube otherwise it'll be pushed over. I know you can use AddForceAtPosition() - but I want to use AddRelativeForce() - relative to the cube's coordinate system.

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 fredz0004 · Nov 29, 2015 at 08:23 PM 0
Share

Have you looked at vector3 reference? Sounds to me like you can use use vector3.up

avatar image daviddickball fredz0004 · Nov 30, 2015 at 10:08 AM 0
Share

Ah sorry, I must have not explain this correctly. I'm trying to move the cube forwards, across the platform. But adding a relative force applies at the center of the cube, which causes it to topple over. I want to add a forward force to the bottom of the cube to prevent this.

avatar image fredz0004 · Nov 30, 2015 at 03:04 PM 0
Share

You don't have to add force from the bottom to prevent toppling. You could lock the Z axis on the inspector, or un check to prevent the force being applied to that axis.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by fredz0004 · Nov 30, 2015 at 03:07 PM

alt text

Take a look at this screenshot. Lock the axis you don't want the force to be applied to. I believe it should be the Z axis.

I hope this helps.


screenshot-2015-11-30-09-01-05.png (324.4 kB)
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 daviddickball · Nov 30, 2015 at 04:49 PM 0
Share

Yeah I could do that, but there are times when I want the object to rotate, like when it falls off the platform. What I really want to do is lower the center of gravity.

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

34 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

Related Questions

Apply a force that is offset and rotated (diagrams included) 1 Answer

Unity2d AddRelativeForce Behaves Randomly 0 Answers

left force right force 0 Answers

BCE0031: Language feature not implemented: Ambiguous(Void AddRelativeForce(Vector3, ForceMode), Void AddRelativeForce(Vector3), Void AddRelativeForce(Single, Single, Single), Void AddRelativeForce(Single, Single, Single, ForceMode)). 1 Answer

Unity 3D : Issue with addForce and Hinge Joint 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