# Use both AddForceAtPoint and change velocity property? [duplicate]

I'm using Rigidbody2D for some game objects. It seems that when I AddForce() or AddForceAtPoint(), the game objects are mostly affected on the Y axis and hardly at all on the x axis. I don't understand why. To really get any effect on the x axis, I need to have a very strong force like *10 000. But the effect on the y axis is then extremely strong and shoots the object out of screen, yet only nudges the game object on the x scale.

I believe that the problem with the y axis is because I use .velocity to move the character. But I don't know how to change the velocity directly without doing that. What should I do to use both forces and set velocity on the same object?

• We would need to see your implementation of ZombieBoyController.AddForceAtPosition() to have the full story. Commented Jan 17, 2014 at 15:35
• You might find this answer helpful - it discusses the pitfalls of setting velocity directly, since that tends to override any other physics influences on the object. You'll likely want to move your character with forces & accelerations if you want them to react to outside forces correctly. Commented Jan 10, 2016 at 14:36
• Your problem with the "required" high forces is, that you aren't applying them "over a distance" - meaning, you aren't actually doing "work" on the object. I'll just suggest to look up the words "Force", "Work" and "Kinetic Energy" in Wikipedia! But here some formula you will need: F = ma; W = Fd; and E = 0.5*m*v^2 Commented Nov 19, 2017 at 13:24
• can you share a code or inspector? Commented Sep 3, 2019 at 18:23

You're using the AddForceAtPosition, which will apply a force to a particular position on the rigid body. You are entering the direction vector on the zombie rigidbody as a position. You should just use the following:

rigidbody2D.AddForce (direction.normalized * force);

• I have the same problem with the y axis wether i use AddForce or AtPosition. But it is the AtPosition that i want to use. I just realized that the problem with the y axis is because i use .velocity to move the character. But i dont know how to do it without changing the velocity. Commented Jan 17, 2014 at 20:00
• Why do you want to use AtPosition? Commented Jan 17, 2014 at 20:49
• Im using at position because i want a force at one point to affect all objects within distance. Why do you seem to think that this is strange? Commented Jan 18, 2014 at 19:12

AddForceAtPosition is the function of RigidBody, right? It would appear that you're calling it incorrectly; it should be force first, then position.