M
M
MoRpo2021-05-06 13:30:19
C++ / C#
MoRpo, 2021-05-06 13:30:19

C# Unity2d, I can't write normal character control code, what should I do?

Give me the character control code, maybe someone uses it? To be with the Ground check, here I have a code with a jump, but the problem is that when a character falls on a wall, he can jump endlessly. How to fix???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil Udartsev, 2021-05-06
@S4MU5

If the problem is only with the jump, then you only need to assign a separate tag to the ground and check the collision only by the tag - then there will be no jumping from the walls and ceiling.
if (collision.gameObject.CompareTag("Your earth tag")) {...}

I
IDzone-x, 2021-05-24
@IDzone-x

Check it out:
https://youtu.be/mjaoJ1rDoaQ

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question