Y
Y
Yaonosos2019-11-10 03:29:17
C++ / C#
Yaonosos, 2019-11-10 03:29:17

How to fix the problem with the definition of the earth?

In general, this is the case: there is a character, a script for determining the touch of the ground hangs on it, so that it is impossible to endlessly jump. But the fact is that sometimes even after touching the ground, the character refuses to jump. I tried changing the ground collider, character collider, but nothing helps.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2019-11-10
@dollar

Note that coordinates are real numbers.
Perhaps your character height is 0.00000000138456827364. That is, above zero. And if you check stupidly by comparison (a > 0), then the character turns out to be hanging in the air. It is necessary to either round or correct for the error, at least up to the 4-5th decimal place:
(a - 0.0001 > 0)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question