1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

Reflection of a character

Discussion in 'Programming' started by Paul Sperling, Jul 4, 2019.

  1. Paul Sperling

    Paul Sperling Member

    Joined:
    Jul 4, 2019
    Posts:
    3
    My game character looks to the right side. I want that when you press to the left that it reflects to the left.
    I use this code for the reflection to the left side. A run animation and jump animation I had and its work

    if (hsp != 0)
    {
    image_xscale = sign(hsp)
    }

    but when I start the game I dont can move and this happens.(watch the picture)

    How can I solve the problem?
     

    Attached Files:

  2. marasovec

    marasovec Member

    Joined:
    Sep 15, 2016
    Posts:
    339
    The code looks ok. Are you sure there isn't anything else manipulating with image_xscale?
     
  3. Paul Sperling

    Paul Sperling Member

    Joined:
    Jul 4, 2019
    Posts:
    3
    Yes I think so
    what could be the reason for that?
     
  4. Yal

    Yal GMC Memer GMC Elder

    Joined:
    Jun 20, 2016
    Posts:
    3,934
    Try using the "search in scripts" feature (under "scripts" in the menu bar) to look for "image_xscale" (in your entire codebase, make sure all the appropriate boxes are checked), then you KNOW if some other code is messing with the variable.
     

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