Tag Info

Hot answers tagged

3

It's because of the discreet time and the way you integrate. Because you step time forward at 1/50 of a second you're not guaranteed to hit the actual apex of 4.0, the delta is just not granular enough. (Try setting the delta time to 1/5000 and you'll see that it gets closer to 4, obviously that won't work for your game but it will show you the effect). ...


2

The intent of your code is unclear; adding comments would help us know what you're trying to do, and making sure that we don't have to scroll horizontally would really help. The first thing I notice, though, is that you check your system AND your update it at the same time, which could result in the behaviour you have: For balls A and B, if you inspect a ...


1

It does not stop, if you don't have friction and gravity, that in normal world slow you down. When applying force, you are really not adding force at all and in fact i am bit surprised that it actually moves at all. You should apply more force, to get your object moving. Try something like this. Vector2.right = Thats the direction of the force Multiply by ...


1

Consider reading books about realworld physics. "In physics, a force is any interaction which tends to change the motion of an object." - Wikipedia. So... By applying force you make it accelerate and decelerate. You need to have friction or don't use physics at all to make it stop at the end of button press.



Only top voted, non community-wiki answers of a minimum length are eligible