+1 vote
This has been a persistent problem for me for a while, and I'm hoping some of you fine folks will be able to help me. I've noticed many weird behaviors arising from my solid bodies colliding with the transition between the individual tiles of my tilesets. For example, the current tileset I'm working with is 32 by 32, so obviously I made the collisionshapes square and made them 32 by 32. This means, when I place two tiles adjacent to one another, their collisions are touching, and certain objects are behaving poorly with it. It's causing me problems with weird behaviors on Rigidbodies and Raycasts.

RIGIDBODY
One of the first things I tried to do in godot was make a rigidbody character. I thought it'd be a fun exercise and teach me a great deal about the engine. However, when I thought it was complete, the character skipped along flat surfaces when moving at decent speed (my platformer is very momentum based). I discovered it was because 2 collisions were coming out from a single spot. This was where one tile transitioned into another, with the two corners throwing out weird collision vectors, causing the character to bounce. I never found a solution to this, so I ended up moving to a kinematic character.

RAYCAST
I haven't given this one as much thought yet, but I'm still solidly stumped. What I currently have implemented is a raycast slightly in front of the character, pointing straight down. The point of this is to sense a ledge in front of the character, and then grab on when an input is pressed. It actually works like a charm except for one thing. When up against a flat wall, the ray will collide with that same thing that's been causing me so many problems: the collision edge located between tiles. This allows the player to grab a "ledge" in the middle of a flat wall. Any ideas (or alternatives) on this one would help me a ton.

NOTE I am completely new to godot and game development in general, but I'm not new to software and coding. I'm a 4th year computer systems engineering student, so I should be able to decipher technobabble. Fire away.

in Engine by (13 points)

Hi, you should remove code formatting for the text that is not code!.

Hey, i found no reference to this anywhere.. perhaps it's a bug.. maybe you should open an issue on github or ask in #godotengine-devel in freenode irc chat.

I'm also using tiles with collision squares, simple 60 x 60 sprites without scripts, and after placing the tiles in my level I saved the scene. Whenever I load the scene all my tiles are in scattered position, separated by 1 space or scattered randomly 2 spaces above the others.

1 Answer

0 votes

If you are using version 3.1, have you tried:

move_and_slide_with_snap()

This article gives more info about how this helps with kinematic bodies and smooth movement. Hope this helps.

by (364 points)

I think rigidbody does not have move_and_slide. Those are for kinematicbodies as far as i know.

Yeah, the OP said they moved to a kinematic body after failing with rigid body.

I know, but i understand that was the workarround he found. I mean, i understood he had problems with rigidbodies and that he solved used kinematic.

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.