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. Dismiss Notice

Resolved Camera and pixel art problem

Discussion in '2D' started by Dartann, Aug 23, 2023.

  1. Dartann

    Dartann

    Joined:
    Jun 10, 2023
    Posts:
    3
    my English is not good, i hope i can explain the problem also newbie here

    when camera move, some of my sprites overflow to direction to camera (if camera going right, sprite overflowing to right direction) I using pixel perfect camera + cinemachine
    Here is video of problem

    it's bit hard to detect problem in video. I also going to put build version of game if you want to see problem yourself
    https://drive.google.com/file/d/1sNGeG1Bfb3sKITthH3LseW62csZLoQ7D/view?usp=sharing

    Sprite settings:
    Ekran görüntüsü 2023-08-23 141606.png
    Ekran görüntüsü 2023-08-23 141927.png

    Pixel perfect camera and cinemachine settings:
    Ekran görüntüsü 2023-08-23 142125.png
    Ekran görüntüsü 2023-08-23 142231.png
    Ekran görüntüsü 2023-08-23 142309.png

    There was also blur problem when moving but i fixed with changing player interpolate setting

    What i try so far:
    • Disabled pixel perfect camera and cinemachine pixel perfect script (problem didn't change/still exist)
    • disable anti-aliasing (noting change)
    • change sprites ppu and orthographic size of camera (used formula Screen Height in Pixels / PPU / 2, noting change)
    • changed sprite filter mode to bilinear (problem still exist)
    Some notes:
    • I did tests with settings: full hd (1920x1080), game scale 1 and play mode is maximized
    • I disable cinemachine completely and manually moved the camera around the scene.
      while not in play mode I can see the problem in game screen. So, problem happens because of camera movement?
    • this problem more noticeable with black color/lines (like weapon outlines)
    I trying to fix this problem past 2 days. I am definitely doing something wrong but dont know what i doing wrong. Thanks in advance for all the help and sorry for bad English
     
  2. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    530
    Only thing I could see was the gun being somewhat jittery.

    That might be caused by the way you synchronize gun position with player position and execution order. Especially if you said that it was observable even with pixel perfect camera disabled and sprite filter mode set to bi linear.

    If you are just simply doing gun.transform.position = player.transform.position, that can become problematic once more than one script is moving things around, more so if physics based movement or interpolation gets involved. If you are not very careful it's easy to accidentally use the position from previous frame or update the position at different rate than the player or camera movement.
     
  3. Dartann

    Dartann

    Joined:
    Jun 10, 2023
    Posts:
    3
    Thanks for reply, karliss

    That jittery happening because of pixel perfect camera. when i disable PPC weapon no longer jittery but no matter what i do overflow problem always exist. its bit hard detects overflow problem on video. if you have time, can you check build version?

    By the way, I found something that confuses me even more, when I equip the weapon, it no longer has the overflow effect on camera move.

    Weapon becoming child object of player object when equipted.
    Ekran görüntüsü 2023-08-23 165340.png

    Here is another video shows weapon no longer jittery when disable PPC and equipped weapon no longer overflow
     
  4. Dartann

    Dartann

    Joined:
    Jun 10, 2023
    Posts:
    3
    After spend 2-3 hours on testing i find out its not unity or game problem... problem is my screen

    i send build project 5-6 different person and all of them say there is no problem. Welp time wasted
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,507
    Hold on, the above isn't a direct screen grab from the computer but is a video taken with a phone/camera? It certainly doesn't look like it and that's the only way it could be a problem with the response time of your monitor.

    If it's a screengrab then it clearly won't show monitor response artifacts.

    Use one of the many tests here to check this: https://www.testufo.com/mprt