Hello Guest

Author Topic: Tilemap + camera uv problem [solved]  (Read 3594 times)

willeml85

  • Newbie
  • *
  • Posts: 9
    • View Profile
Tilemap + camera uv problem [solved]
« on: January 20, 2013, 03:38:21 pm »
Hello everyone,
I would like to ask if there is a solution for the behavior that is occuring in the following example image.



It seems that the UV's are overlapping/moving when the camera moves.

Thank you
« Last Edit: January 21, 2013, 02:44:08 pm by willeml85 »

willeml85

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Tilemap + camera uv problem
« Reply #1 on: January 21, 2013, 02:38:25 pm »
I solved this by using ragepixel's camera.

self.position = new Vector3(Mathf.RoundToInt(player.position.x) + 0.05f, Mathf.RoundToInt(player.position.y) - 0.05f, self.position.z);

with just this line, it works good now.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Tilemap + camera uv problem
« Reply #2 on: January 21, 2013, 02:44:21 pm »
That just makes sure the camera is always snaps to the closest pixel on screen instead of interpolating between pixel fractions, etc. Its always good to do that, and also make sure your sprites are on pixel boundaries too.