A
A
Alha16902019-01-07 18:44:21
C++ / C#
Alha1690, 2019-01-07 18:44:21

How to write animation code for DragonBones and Unity?

I had such a problem with the implementation of the DragonBones animation in Unity. I made a walking animation for the character on the A and D buttons. That is, if A or D is held down, the animation is played. When in the game you need to hold down both buttons (A and D), and then release one of them, the animation should continue, but it stops for me. There's no way I can fix this. We tried a lot of methods, but the attached code did not work out better. Please help if someone knows how to solve this problem.
Video showing keyboard actions https://youtu.be/V8FjvDEFgPM
The code that I already have is attached below.
5c3372f9dc33f035352046.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2019-01-07
@MrMureno

flags)
just remember which buttons you pressed ..
but this is about ... I don’t even know the basics. examples. disassemble.
structures, patterns .. that's all for beginners to read .. and it will be easier)) You
would write the conditions for yourself the algorithm block diagram, boundary conditions and all that))
otherwise you wrote code .. that behaves as you wrote))
or a crutch - when checking for an animation stop, add the condition "the second button is not clamped"
something like

//Отпустили D , когда A еще зажата)
if(Input.GetKeyUp(KeyCode.D) && !Input.GetKey(KeyCode.A))

And insert the code CODE .. not pictures.
You would still cram a picture into Word. the document is archived.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question