0 votes

This is a duplicate post, but I originally made the question far too long, and included a bunch of my own ideas that aren't likely helpful. I tried to edit that post and bump it, but it stayed burried, so I'm reposting the new (hopefully improved) version of the question here.

I'm just going to share the gif, and hopefully it's something that someone recognizes. I'm sure it has to do with import or project settings or similar.

Basically, my sprites are deforming in different ways when I move the player. Sometimes they shift in one of the cardinal directions, and sometimes they expand or contract on the x or y. It happens regardless if the camera moves.

The title says "Unity Problem" but that was just a mistake when I posted it. This is in Godot.


in Engine by (14 points)
  1. Test the 'pixel snap' setting in project settings?
  2. How are the sprites added to map? Not tiles?
  3. How does map 'move'? Move map and all children or move only camera?

Thank you.

  1. I have turned Pixel Snap on and off (assuming you mean (Project Settings -> Quality -> 2d ->Use Pixel Snap)
  2. Tiles, Node2d objects, and StaticBody2D objects all have the same behavior. In the gif, the Trees and Bushes are StaticBody2D, the cliffs are a tilemap, and the smaller grass clump is a Node2D.
  3. The camera moves. It is following the player via a remoteTransform2D. I have also tried making the camera a child of the player for testing, and it acts the same. If I leave the camera static the problem goes away.

I've also tried setting the camera to Physics and Idle Process Modes, and changing all script methods between process and physicsprocess to both match that and to the oposites of what would match (eg. physicsprocess function and camera set to Idle).

I've also tried exporting the game instead of running it in the editor.

Edit: I just noticed that in the gif the cliffs never show the problem, but they do sometimes. It seems almost random what everything acts like from one run to the next.

Thank you. That is exactly the problem.

The short version is that pixel snap isn't used by Camera2D, so if you use a moving camera you have to implement that in code. The fix is pretty simple, and camera smoothing is easy enough to implement. It's a little disappointing that turning on pixel snapping and camera smoothing doesn't just work though. Cameras following the player aren't exactly rare.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.