I
I
Ilya_malet2021-10-26 18:26:13
Unity
Ilya_malet, 2021-10-26 18:26:13

How to implement the dependence of speed on the distance between two points?

Hello, help me implement a system for changing speed from distance. There is a condition variable called speed, and there is also a distance between two points that is updated every frame. I need to create a dependency, the greater the distance, the lower the speed. Thanks in advance for your reply!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2021-10-26
@freeExec

speed = 2587412 / distance

L
LittleBob, 2021-10-26
@LittleBob

Just in Update divide the current speed by the distance.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question