Forum begins after the advertisement:


[Part 4] Cast and Heal problem

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [Part 4] Cast and Heal problem

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #15931
    Joseph Tang
    Moderator
    Helpful?
    Up
    0
    ::

    Ah alright, after taking another look and your confirmation on holding the button.

    The reason you’re still firing the DarkBullet spell despite you not being supposed to by code. I’ve found that your castOrhealTimer isn’t actually changing in getInput(). due to the line being slightly incorrect.

    Just add a + in castOrhealTimer = Time.deltaTime

        void getInput()
        {
            xAxis = Input.GetAxisRaw("Horizontal");
            yAxis = Input.GetAxisRaw("Vertical");
            attk = Input.GetButtonDown("Attack");
    
            if (Input.GetButton("Cast/Heal"))
            {
                castOrhealTimer += Time.deltaTime;
            }
            else
            {
                castOrhealTimer = 0;
            }
        }

    Then do tell whether it works now.

    #15933
    pepe cry
    Participant
    Helpful?
    Up
    0
    ::

    Thank you for helping me. It work perfectly now. Very greatfully all of your help but I found another bug. If I’m dashing to the top of the enemy, my game is freezing and i cannot do anything. It looks like this
    how bug happend
    My character take dmg and then it freezing. It’s not the unity freeze because i still can stop the game or check the inspector. Here is the video how it happend. If this bug can fix in the up comming video so can you show me which part so i can fix it. Thanks you very much
    demo how the bug happend
    again sorry for take your time so much

    #15934
    Joseph Tang
    Moderator
    Helpful?
    Up
    0
    ::

    This bug is addressed in Part 6 of the series at the first minute mark.

Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: