W
W
WasTabon2022-01-09 02:55:17
Unity
WasTabon, 2022-01-09 02:55:17

Asset for 2d ball throwing, or how to write one yourself?

So that you can swap and, depending on the strength and direction of the swap, the ball flew there, throw off the guide, or some kind of asset on this. Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ente, 2022-01-09
@WasTabon

You take the point of the first touch, you mark the current game time. Then you check when this touch has disappeared, you look at the time difference. Also consider the distance between them. Using distance and time, you can calculate the impact force, you can choose your own formula, for example, speed depends more on distance or vice versa, the less time has passed, the stronger, but both are better. Also, knowing two points, you can easily find the impact vector.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question