Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Character blinks when walking by background object

Discussion in '2D' started by xeonheart, Jun 9, 2020.

  1. xeonheart

    xeonheart

    Joined:
    Jul 24, 2018
    Posts:
    219
    Hello,

    still getting use to Unity, for some strange reason, I have my character able to walk using the mobile joystick, i added a small door or bush, when I walk by it, it blinks... not sure why, or when i jump my character disappears, I made sure my character layer and tag is added, but not sure if there is additional steps i need to do to make sure the character stays in front?
     
  2. Neomedus

    Neomedus

    Joined:
    May 14, 2020
    Posts:
    47
    Make sure your character is in a higher layer than the other objects.
     
  3. xeonheart

    xeonheart

    Joined:
    Jul 24, 2018
    Posts:
    219
    Hey Neomedus, thanks, ya i checked and made changes just now, for some reason, it still blinks, i have the bush and door at 10 and 11, and the player is at 8, and still blinks, anything else i should check? I noticed i think on certain animation of the character gets blinked or behind the other objects, but when it goes to the other animation frame, it stays in front... any idea what that is all about?
     
  4. Neomedus

    Neomedus

    Joined:
    May 14, 2020
    Posts:
    47
    Are you building your game using a unitypackage as a basis? Also, the higher the order in layer the higher up the object is, so try putting the objects at a lower number than the player. Make sure they are in the same sorting layer too.
     
  5. XsvGamer

    XsvGamer

    Joined:
    Apr 9, 2020
    Posts:
    20
    I've found sometimes it's due to the player and the object having the same tags... trying changing those maybe.. I had the same problem with floating platforms and my player - I had them left as default. So i changed the platforms to Ground and my player to well, player... lol - I'm a noob too - but it did the trick... :)
     
  6. xeonheart

    xeonheart

    Joined:
    Jul 24, 2018
    Posts:
    219
    Hey Sorry for the late reply, so I made sure my "Player" Label is number 1, then the door is on the 4th, but still blinks when i run by, the good thing i notice is, when my player is idle by the objects, it doesnt blink anymore, but when i only run by it blinks by a bush or any object specifically the door layer object that is 4th... any ideas?
     
  7. Neomedus

    Neomedus

    Joined:
    May 14, 2020
    Posts:
    47
    Can you post a screenshot of the inspector view for your player and for your bush?
     
  8. xeonheart

    xeonheart

    Joined:
    Jul 24, 2018
    Posts:
    219
    ugh, i am an idiot... ok, so I am sorry if I ASSumed the player layer was above the door, it wasn't... I moved the layer to above, saved it, restarted unity... and now works great... sorry and thank you for taking the time to help me out :)
     
    XsvGamer and Neomedus like this.