0 votes


I am currently learning Godot and I am loving it so far. I have a couple of years of basic programming knowledge behind me so I am not completely new to programming. I have given myself the challenge of creating a very basic terraria clone as my learning project and have been fiddling with it for a couple of hours, following tutorials for the basic collision and player input. Everything worked fine until today when I started messing with the players sprite.

After i completed the setup of player sprites I started my game and the collision where off, very off. As soon as the player lands on a tile in my tilemap the screen starts shaking and the player is unable to jump. I turned on the collisionmaps in debug mode and they are behaving very wierd. The player collision box is "sinking" into the tile box for a split second and then popping back up, causing the shaking. I've been redoing the collisions a number of times and reviewing my code and I am unable to understand what is going on. If anyone could download my project from the link at the bottom and solving my problem or maybe propose a solution I would really appreciate it. I am totally stuck and can't move forward.

I uploaded my project on https://www.file.io/. You can download it here to check for yourself of how this problem behaves and review my files and setup: https://file.io/nJfrgN

I sincerely appreciate any help you guys are willing to give as I am really digging this engine and wan't to learn and move forward.

Thanks in advance.

I added a new download link as my previous one would be invalid after one download. This one is valid for 1 week from today.

asked Feb 1 in Projects by jonnte99 (15 points)

1 Answer

+2 votes
Best answer

Select your Player-node from the tree and change the value under Collision > Safe Margin into 0.08. That is its default value. You might have set it to a lower value by accident. To find out what it does, take a look at the documentation.

answered Feb 1 by njamster (8,874 points)
selected Feb 1 by jonnte99

You are awesome! At first I was confused as I checked the value in my player scene and it was 0.08 and it made no difference. Then I saw that it was changed to 0.01 in my root scene, which caused the problem. Such an easy solution.

Thanks a bunch!

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.