Tag Info

New answers tagged

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.


1

void OnCollisionEnter2D(Collision2D coll) { if (coll.CompareTag("Enemy")) // more efficient { ContactPoint2D contact = coll.contacts[0]; for(int i = 0; i < 5; ++i) // should probably be completely replaced with a particle system depending on your goals. { GameObject rock = Instantiate (rock, contact.point, ...



Top 50 recent answers are included