J
JJ
posted to: The EntityPlacer

Having issues with the blueprint position in the grid and the final position once installed

I noticed on the EntityPlacer node tutorial that the grid was off related to the squares on the ground, but I thought that maybe it has its purpose.



But when I had the code to place blueprints it started to get weird, the blueprint position seems to be off the grid for the ground


And once placed it seems to adjust to a "good" position (I don't think is the best one, maybe my engine is a bit bigger than it should?)



This is the inspector view for EntityPlacer


Any ideas on what can be causing this?

Here is a link to the Gitlab repo with the code until this point
https://gitlab.com/godotjj/tutorial-simulation-game/-/tags/v0.1.1

  • Nathan Lovato replied

    Hi JJ,

    At the moment we're traveling to GDC, and I'm unable to test Godot projects on the tablet. The cause of this is most likely in the code rather than in the Inspector settings. Especially if you use Godot 4, I don't know how much the tilemap API and behavior changed.

    The blueprint seems to be offset by half a cell, so in code I would just try to offset it by half the value of the Tile Size property.

  • J
    JJ replied

    Hi Nathan!

    Thanks for your suggestions, I finally found and solved the issues.

    The first one was the origin point of the Engine entity and blueprint, it was very wrong in the blueprint and a bit wrong in the entity.




    Solved it moving it to where the course says.




    The second issue was the POSITION_OFFSET in the EntityPlacer script. It should be removed completely because in Godot 4 it seems to return the correct value.



    1 love