Implementation in C#

Hello everyone! I’m making a 2D side-scrolling game. with simple 3-hit melee combat. On my way to implementing it, I found a conflict between the player movement script and the melee combat script. where the transition from Idle to Hit_1 breaks itself. I can only press J once, and 1 frame of the first melee animation plays; after that, it loops itself to Idle. The problem I notice is that idle works with the IsMoving and IsRunning parameters inside the animator. Meanwhile, the new script doesn’t work that well, so I made this code: https://paste.ofcode.org/MVk5fq9vV2NMsSLiH33Yhb to fix the issue, but it seems that I’m getting more issues than solutions. Apologies if my code looks bad; I’m not that smart at coding.

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is the bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, log output, variable values, and especially any errors you see
  • links to documentation you used to cross-check your work (CRITICAL!!!)

The purpose of YOU providing links is to make our job easier, while simultaneously showing us that you actually put effort into the process. If you haven’t put effort into finding the documentation, why should we bother putting effort into replying?

If you post a code snippet, ALWAYS USE CODE TAGS:

How to use code tags: Using code tags properly

  • Do not TALK about code without posting it.
  • Do NOT post unformatted code.
  • Do NOT retype code. Use copy/paste properly using code tags.
  • Do NOT post screenshots of code.
  • Do NOT post photographs of code.
  • ONLY post the relevant code, and then refer to it in your discussion.