V
V
vorttecs2020-02-05 15:07:19
C++ / C#
vorttecs, 2020-02-05 15:07:19

How to make a character run all the time?

I want to make the character move in one direction

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2020-02-05
@vorttecs

newPosition = currentPosition + speed*deltaTime*normalDirection
Here's some pseudocode for you. Because the engine is not specified - that's just the way it is.
Although on the unit (I smell it) - in principle, the code will hardly change. And the algorithm is 100%

I
Igor Dmitrashko, 2020-02-18
@Gorik2927

transform.Translate(direction * Time.deltaTime)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question