A
A
Artem Kravchenko2020-08-16 13:10:24
Unity
Artem Kravchenko, 2020-08-16 13:10:24

How to make an object move in Unity?

How to make an object, namely a sphere, move in a given direction after clicking? I want to do something like in that game about balls (as in the picture). 5f390590047f4459076512.jpeg

The only thing I found to resolve the issue is that you can use Rigidbody2d.AddForce() , but I don't understand how to use it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Prizm, 2020-08-16
@PrizmMARgh

0. add script components (control program), some hitbox (for example, spherical) and rigidbody (physics control element) to the required
body , fix the axes of rotation / movement of the body and something else on the little things.
2. If you need a "hit on click", then create an onClick method in the script and insert a call to Rigidbody2d.AddForce();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question