Someone can explain me why godot erase/move the details of my png?

Godot Version

4.4.1

Question

` Hello, I’m programming a small game, a runner. I use the same PNG for the initial ground as for the ground blocks that are generated. The problem arises with these generated blocks: the details of the PNG are erased or end up shifted to the right. In other words, it modifies the PNG. Why does this happen?
you can see the issue in the images, the floor must tu be the same. but the blue details are removed


It’s kind of hard to say without more information. Are those blocks on a tilemap? Are they sprites?
How are you putting them in the scene?

hello, those blocks are rigidbody with a sprite in it, those blocks are spawned every,out of the screen, time a signnal is triggered. All the blocks have the same image attached to the sprite

It’s really hard for me to understand the actual problem.
Are you saying that the blue details on the ground texture get removed or moved after you start the game? are this blue details part of your ground texture or they are separated node attached as a child to them? It would be cool if you upload an image of your scene tree or provide the related script.
Maybe the problem is scaling. make sure to not scale any physics node such as Rigid body, Static body and Area, try change their collision shape size.
And why your blocks are Rigid body? are they suppose to move or have physic is some way? if not why not make them Static body.

hello, yes the detais of the grund texture are moved/removed. They are a rigidboy with a sprite2d i will try to not scale the physics node.

Are all of those little blue things an individual Rigidbody? that’s not good. are they suppose to have any physic or any part in game play rather than a ground decoration? if not try this things:
if they are just decoration for ground so it don’t look simple, just try adding them to your actual ground texture png, like edit the image in Krita or Gimp or even Paint.
If that is not possible you can have them be a single Sprite2d, instead of a whole Rigidbody

Scale in Godot propagates to children.

You are right, but the engine tell you that you should not scale the RigidBody itself
“Size changes to RigidBody will be overridden by the physics engine when running”
So i think it is a bad idea. I am still not sure what is the OP issue tho.

No, the blue parts are not individual rigidbody, just details of the png.

you are right, thanks a lot i spend days figuring out

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.