StevenyJames

So I am creating a 2D platformer in Unity and have been using Spine to set up the animations. After exporting and playing with the animations in Unity I am finding that when I am running (using A or D keys) and also press the Space key the Character will jump, Which is great, exactly what I need. However due to the nature of the game it requires you to still hold a directional key whilst jumping, and when the character lands again it is stuck in the jumping animation until you release the directional key.

This is a bit of a pain as it ruins the speed and look of the game. I assume this is because of the Input.GetKeyDown method of controlling the character however I was wondering if there was some sort of way around this?

To clarify I am looking to get the run animation to continue playing once the character lands from a jump or fall without having to remove my finger from the directional key. I have attached the code snippit that concerns the two animations (the unsheath part works fine) .
У вас нет необходимых прав для просмотра вложений в этом сообщении.
StevenyJames
  • Сообщения: 3

Pharan

There is sample code that does this in the Examples folder of the unitypackage.
Open 4 Object Oriented Sample
Аватара пользователя
Pharan
  • Сообщения: 5366

StevenyJames

Ive found the solution. Thank you very much for your quick reply!
StevenyJames
  • Сообщения: 3


Вернуться в Unity