• 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
0
Question by vinicius47 · Jul 11, 2014 at 05:36 PM · physicsrigidbody2daddforcerocketaddforceatposition

Rigidbody2D and AddForceAtPosition

Im trying to make a rocket, and im using an empty gameobject parented to the rocket for the motor position, the point where the force will be applied, here is my code: motorPivot = GameObject.FindGameObjectWithTag("motorPivot").transform.position; rigidbody2D.AddForceAtPosition(transform.up * force,motorPivot); Even with the motorPivot exactly equal to the transform.position of the rocket, im getting diferent results when i put transform.position instead of the motorPivot. With transform.position, the rocket move upwards regardless of the world pos of the rocket (that is correct). With the motorPivot (wich is exactly the same values of the transform.position), the rocket slight rotate twards the center of the world.

Whats wrong?

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 vinicius47 · Jul 11, 2014 at 05:29 PM

I figured out whats wrong, i have to update the motorPivot position inside the FixedUpdate, with the addForce.

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

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

move 2d character affected by physics with velocity and/or add force 2 Answers

2D Rotate towards GameObject acting odd. 2 Answers

Rigidbody2d.addforce in the direction of mouse problem 1 Answer

Need help on my script to calculate gravity for a mass 1 Answer

Unity 2019.3.0f6 - Trouble with physics, cubes turn left after some meters 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges