GMS 2 Character Knock back Doesn't Exist (SOLVED)

Discussion in 'Programming' started by BlueBird02, Feb 11, 2019.

  1. BlueBird02

    BlueBird02 Member

    Joined:
    Jul 25, 2016
    Posts:
    52
    I made sure I typed down everything from this tutorial video.



    I added the enemy knockback code, and it works just as I expected.

    But when I added on the player character (and made sure to copy the code from the video), all I get is this tiny message: state.PNG

    It didn't crash the game, but it didn't make the main character do her knock animation. help.PNG
    She does take damage and die, but she doesn't activate her knockback code.

    Is there something I missed putting? I made sure to copy the code on the Knockback_state script.
     
  2. TheSly

    TheSly Member

    Joined:
    Jan 16, 2017
    Posts:
    947
    The large screenshots don't really help us know what the problem is. We need to see the code relating to the problem. Show us the create code where you define the knockback state. Show us some code where you are calling the state. Ensure you put [.code.] and [./code/] around the code, without the period, so we can read it easier.
     
    BlueBird02 likes this.
  3. BlueBird02

    BlueBird02 Member

    Joined:
    Jul 25, 2016
    Posts:
    52

    all right! Here are the screenshots!

    This is the obj_hero's (Player) create code
    create.PNG

    This is obj_loopy's create code (Enemy)

    enemy.PNG





    and this is the knockback code script. (The player, and enemy's code)

    knock.PNG
     
  4. Bentley

    Bentley Member

    Joined:
    Jun 18, 2017
    Posts:
    765
    Are you moving the player with knockback_speed?
     
  5. TheSly

    TheSly Member

    Joined:
    Jan 16, 2017
    Posts:
    947
    What's the code where you are calling the knockback script, and where are you defining the states? Also we don't need screenshots, you can just paste the code directly if it's easier.
     
  6. BlueBird02

    BlueBird02 Member

    Joined:
    Jul 25, 2016
    Posts:
    52

    Nevermind, I spoke to the creator and he helped me with the problem. Thank you for your willing to help
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice