• 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 dakshesh1010 · Jan 20, 2017 at 10:30 AM · rigidbody2dphysics2drigidbody.addforcerigidbody physics

Avoid varying output on same amount of force applied to a Rigidbody2D.

So I have a Rigidbody2D (bot character) with a polygon collider on it. The shape of the collider resembles a pencil (somewhat). There's another Rigidbody2D with similar shape (the player's character). On collision of player with the bot, I'm applying force on the player.

Each time the force is applied, the behavior is different. Sometimes the force is quite low, and sometimes it is exactly what we want. Can't figure out how we could avoid this, and each time a consistent force is applied.

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 MelvMay ♦♦ · Jan 20, 2017 at 10:42 AM 0
Share

Are you sure you're not adding for in any 'Update' call as this can lead to frame-rate dependent forces? If you're calling it in the OnCollisionEnter2D you will be okay as this is frame-rate independent.

I presume the Rigidbody2D is a Dynamic body-type? If so the physics system applies its own impulse forces to ensure that its colliders are separated from other colliders it's allowed to contact. $$anonymous$$aybe your forces are opposing/conflicting with those forces?

You haven't detailed directions of collision and the forces you're applying so it's all guesswork here unless you provide more detailed info. The more info you provide, the more likely you'll get an answer.

0 Replies

· Add your reply
  • Sort: 

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

90 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

Related Questions

How create a Tunnel for gameobject to follow the tunnel path. 0 Answers

RiigidBody2D.AddForce() isnt working at all. 0 Answers

Conserve some of Rigidbody's speed when turning. 0 Answers

How to prevent AddForce from stacking up ? 1 Answer

Confused about addForce behavior on 3D objects w/ sub-objects in 2D movement 0 Answers

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