Tag Info

Hot answers tagged

3

I think it will work if you combine your input listener with: animation.isAnimationFinished(stateTime); While playing animation ignore attack input and let it just continue playing. When the animation finishes you can respond again and start a new animation by reseting the stateTime. But I would also have in mind that the player can move meanwhile and ...


2

If you call coroutines this way they will be executed in order, one after another. You should fire them up with StartCoroutine(Aiming()); public IEnumerator Aiming() { yield return StartCoroutine(LoadBow()); yield return StartCoroutine(DrawBow()); aimStates = AimStates.Aim; } ...


1

You could set a boolean for example to false before yield and then after the time had passed set it back to true and then just use if statement to check if the boolean is true/false. What about efficiency, I think there's not much of a difference. From what I understand the delay from coroutine affects only something you change before and after the delay so ...


1

You currently have a typo in the line you posted: this.canvascanvas.Height should be: this.canvas.canvasHeight Alternatively, you can use canvas.width and canvas.height as shown in this StackOverflow answer. Debugging tip When this type of code snippets don't work, try just outputting their values to the console with console.log(...). In your case, ...



Only top voted, non community-wiki answers of a minimum length are eligible