1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

GMS 2 Textures are messed up

Discussion in 'Programming' started by mikix, Nov 10, 2019.

  1. mikix

    mikix Member

    Joined:
    May 2, 2017
    Posts:
    381


    As you can see on the video, sometimes when the boss switches his sprite_index, it gets kinda glitchy and some random tileset sprite shows up.

    How do I fix this?
     
  2. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,661
    Try clearing the project cache (broom icon near the run button in the IDE) and recompiling / running the game.
     
  3. mikix

    mikix Member

    Joined:
    May 2, 2017
    Posts:
    381
    I've done that several times.
     
  4. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,661
    Oh, well sorry, I'm not psychic and you didn't mention that in your OP.

    Are you sure the graphics that pop in are from a tileset and not another sprite that could be caused by an incorrect image_index assigment or your code switching sprites for a frame when it shouldn't be?

    Also try manually clearing all caches, closing GMS2, reopening it, then loading and running your project.
    Find the buttons to do this in File > Preferences > General > Paths
     
  5. mikix

    mikix Member

    Joined:
    May 2, 2017
    Posts:
    381
    All I had to do was delete this code and it works fine now
     
  6. Mike

    Mike nobody important GMC Elder

    Joined:
    Apr 12, 2016
    Posts:
    2,393
    This type of code does not work in GML. You need to break it up into multiple lines.

    Code:
    global.boxer_boss_action_l = sprite_index = spr_boxerboss_stun
    
    becomes

    Code:
    global.boxer_boss_action_l = spr_boxerboss_stun;
    sprite_index = spr_boxerboss_stun;
    
     
  7. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,984

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