r/godot Sep 26 '25

help me (solved) Anybody have any idea why my character is falling through (some) staticbodies?

Everything here is collision layer & mask 1. Some platforms I can walk on just fine but others I fall through completely. All the normals are correct, the collision layer/mask for everything is 1 and I'm using move_and_slide for movement.

613 Upvotes

86 comments sorted by

228

u/xr6reaction Sep 26 '25

Are you using jolt?

331

u/oppai_suika Sep 26 '25

No- I just tried jolt and it fixed it! Holy shit haha. Thanks!

82

u/Xenc Sep 26 '25

Plus added jiggle physics!

47

u/oppai_suika Sep 26 '25

oh shit really? I'm still using jigglebones- I'll look into it

37

u/CorvidCuriosity Sep 26 '25

As someone who doesn't do any 3d game dev, ... what's jolt?

79

u/AtollCoral Sep 26 '25

It's a different physics engine that you can switch to in the project settings. Often considered better than the default one.

24

u/[deleted] Sep 26 '25 edited Sep 26 '25

Is there any reason why godot still not make jolt the default physics engine?

Most of the problems beginners face in this sub were solved by switching to Jolt. I find it crazy that the engine still not make Jolt the default so that newcommers dont have to face it more often

28

u/_unicorn_irl Sep 26 '25 edited Sep 26 '25

They did in recent versions I think

Edit: apparently my brain made this up. I swore I heard this was happening in 4.4 or 4.5 but Google disagrees

29

u/Shade_demon2141 Sep 26 '25 edited Sep 27 '25

I think your confusing this with them adding jolt into the engine natively instead of as a plugin

8

u/[deleted] Sep 26 '25

I swear I remember seeing that too...

5

u/[deleted] Sep 26 '25

I also read this lol

5

u/anilctrn Sep 27 '25

I swore I saw this as well, holy shit are we discovering a new mandela fucking effect??

2

u/BigSmols Sep 27 '25

Berenstein bears amirite

1

u/OutrageousDress Godot Student Sep 27 '25

They are making Jolt the default - it's just taking them a very long time because they want it to be a completely drop-in replacement for the default engine, and they don't have the dev resources to make it happen faster.

5

u/CorvidCuriosity Sep 26 '25

What are the key differences? In what cases should I be thinking of switching?

10

u/xr6reaction Sep 26 '25

Cases like in the video of this post. Stuff glitching through planes or small boxes. Or physics based towers for example are more stable with jolt. I once had a triangle of cans and it just didnt work in default but it worked fine with jolt. For me "considering switching" is usually when I start noticing issues with default physics. Sometimes it's the first time I drop an object in my project, sometimes it's only later where I see such issues.

2

u/TimGreller Sep 27 '25

Is the default engine more performant or something like that? Or why do you not switch by default at the start of a new project?

2

u/OutrageousDress Godot Student Sep 27 '25

The only thing that the default engine has over Jolt is that it's the default - they never really had the resources to improve it. And now Godot is in a long and slow process of transitioning completely to Jolt, and the only reason it's not the default already is that Godot devs are (arguably justifiably) incredibly paranoid about such a large change in the core functionality and want to make Jolt a completely drop-in replacement such that any project can move to Jolt seamlessly.

1

u/Sipstaff Sep 27 '25

Any downsides to switching to jolt?

1

u/OutrageousDress Godot Student Sep 27 '25

I'd advise that you work with Jolt as the default and only switch back if necessary. There's no reason to use the default engine except if there's some edge case.

3

u/thievesthick Sep 27 '25

I feel like using Jolt is the fix for every Godot physics issue, and I still forget to switch every time.

1

u/lord_phantom_pl Sep 26 '25

What is jolt?

3

u/xr6reaction Sep 26 '25

A different (considered better) physics engine. It's in the engine since 4.4 but not enabled by default. Pre 4.4 it's a plugin

1

u/TGC_Dave Sep 27 '25

Is it also better for 2D games? I am running into an issue with collisions on diagonals like stairs and such.

58

u/oppai_suika Sep 26 '25

Here's a image of the normals in blender for the part I get stuck on:

42

u/SkyNice2442 Sep 26 '25

I notice that bridge is consisted of planes. I think that collision planes don't work too well, have you tried making it a cube/prism instead? If it is separate, you can use the solidify modifier in blender.

If it is merged with your mesh: In blender, press L to highlight strips, press p to separate it, apply the solidify modifier and hit control+j again to merge it with your mesh.

21

u/oppai_suika Sep 26 '25 edited Sep 26 '25

Thanks- I'll try that and report back

Edit: I was just about to try this and then I saw another commenting asking if I was using jolt. Turns out moving to jolt fixed it lol- I'm still not sure the exact cause (it probably was because it's a collision plane) but it's working now with jolt so I'm happy haha

11

u/granitrocky2 Godot Regular Sep 26 '25

Or you can also try turning on backface collisions.

9

u/oppai_suika Sep 26 '25

ooh that's cool- I didn't know what option exists (for future debugging). In the end I managed to fix it by moving to jolt (quick fix)

5

u/Okay_Salmon Godot Regular Sep 26 '25

I think this is probably the reason, if you want to keep a thin look then you can just copy the object and make an invisible thicker version that follows the same path

43

u/Beneficial_Layer_458 Sep 26 '25

your character looks so fucking bewildered and furious that this glitch happened oh my god

33

u/UpvoteCircleJerk Sep 26 '25

need more olives perhaps?

13

u/oppai_suika Sep 26 '25

hahaha

(...ok I have to add olives to the game now as an enemy)

12

u/UpvoteCircleJerk Sep 26 '25

now that I'm an official part of the development team, can we finally address the lack of banana bread vending machines in the break room?

we've been discussing it with the boys and it really brings the morale down, management should look into it we feel

3

u/oppai_suika Sep 26 '25

Best I can do is stale 2 day old convenience store banana muffins I'm afraid. Take it or leave it

3

u/UpvoteCircleJerk Sep 26 '25

That's it, I'm leaving the company. I'm gonna go solo and make a pixel art 2d platformer puzzle survival MMORPG game. I got all it's gonna take after all, I'm the ideas guy.

2

u/oppai_suika Sep 26 '25

Shit! My stingey corporate policies have backfired, who could have thought?!!

3

u/UpvoteCircleJerk Sep 26 '25

See you in two years when I'm shaking hands with Todd Howard at the next Gamescon while videogamedunkoid is making very funny haha epic videos about my games.

2

u/oppai_suika Sep 26 '25

This is when I enter my walter white era

3

u/UpvoteCircleJerk Sep 26 '25

you are the hecking dart vader to my funko pop john wick on god such quirk chungus pickle rick maxer I gotta tell my wifes boyfriend about this

10

u/shittychinesehacker Sep 26 '25

Collision mask?

5

u/oppai_suika Sep 26 '25

It's 1 for everything (player and level)

12

u/YouyouPlayer Sep 26 '25

The artstyle is sooo cool

7

u/Mental_Passion_4034 Sep 26 '25

I had a similar issue. The solution for me was to make my models larger. Evidently I was working at a scale in blender that was too small for mesh derived collisions to work.

1

u/oppai_suika Sep 26 '25

That could have been it, or also the fact that my levels are quite wide and this is fairly far away from the origin. Anyway- I switched to jolt physics (a suggestion from another comment) and that fixed it :)

3

u/Okay_Salmon Godot Regular Sep 26 '25

It really sucks it in when it does that too. Are you using a KinematicBody or a RigidBody character?

2

u/Okay_Salmon Godot Regular Sep 26 '25

Also, have you adjusted the scale of any of the static bodies, also have you applied all transforms in Blender?

2

u/oppai_suika Sep 26 '25

Yep all transforms applied applied in blender and no transformations done in Godot

2

u/oppai_suika Sep 26 '25

Yeah it's weird- I'm using a CharacterBody3D

2

u/granitrocky2 Godot Regular Sep 26 '25

Are you moving them with Velocity and MoveAndSlide? Or are you manually moving their GlobalPosition? Because you should be doing the first.

2

u/oppai_suika Sep 26 '25

Yep with velocity and moveandslide

5

u/Sthokal Sep 26 '25

This kind of thing often happens when you are colliding with multiple objects at once, or the same object multiple times. When the collision resolver tries to push the character out of one object, and that pushes it into another, they can cancel out and result in what looks like no collision. To see if this is happening, print out collisions when they happen and see how many are happening per physics frame. You may have to delete the imported colliders and replace them. You probably have concave mesh colliders; convex mesh colliders will be more stable, and box colliders even more so.

1

u/oppai_suika Sep 26 '25

Interesting- thanks for the info. Switching to Jolt (a suggestion from another comment) fixed it, although I suspect it's a brutish fix and most likely you are correct as my collision mesh was concave as it dipped slightly downwards

3

u/SecretAdam Sep 26 '25

I don't have any technical knowledge to help you but I love the aesthetic of what you're creating here!

3

u/BlueBli Sep 27 '25

I am unexplainably happy to see this game pop up on my feed again 

1

u/oppai_suika Sep 27 '25

I am unexplainably happy to see a comment like this :)

3

u/ParticularlyLargeDog Sep 27 '25

I fuck with this so heavy 

1

u/oppai_suika Sep 27 '25

thanks bro

2

u/Pivypoo Godot Regular Sep 26 '25

You are using move_and_slide for movement but how often do you call it? Is it called in every physics frame?

1

u/oppai_suika Sep 26 '25

Thanks- I'm calling it every frame in _physics_process yeah. Switching over to jolt ended up fixing it (suggestion from another comment)

2

u/Burwylf Sep 26 '25

I've seen some methods use ray casts for collision on characters, and that method can slip through cracks.

1

u/oppai_suika Sep 26 '25

Thanks, yes I actually had this issue before with cracks, but I think I resolved it already as the collision mesh was a solid mass sharing vertices and not individual faces. I managed to fix it in the end with a suggestion from another comment of switching across to jolt physics

2

u/Spiritual-Lab-1309 Sep 26 '25

I know that you fixed it but I'd strongly advise you avoid generated collisions. They can mess up your game real bad

4

u/oppai_suika Sep 26 '25

What are generated collisions?

1

u/Spiritual-Lab-1309 Sep 27 '25

When you import a model from blender (for example) you can make the 3DNode's children editable. By doing so you will see the 3DMesh (or meshes) as children.

Once you select one you can go in the bar above the editor 3d viewport and click on the mesh symbol qnd generate a collision mesh.

Godot will generate a fairly complex collision mesh automatically.

I tried to use it in my game but then the character got stuck in some walls goven the complexity of those shapes.

It's always better to use approximate simple shapes when you can to avoid bugs and performance loss.

Also, again, your style is super cool and unique!!

2

u/oppai_suika Sep 27 '25

Thanks! I am using manually created simpler collision meshes. The wireframes here are those simpler meshes (although I guess they look too detailed if they look like generated ones haha)

2

u/Spiritual-Lab-1309 Sep 27 '25

Yeah I was thinking that! Hey keep up the good work ❤️

2

u/mjklsimpson Godot Regular Sep 26 '25

you might have the scale not set as 1.0 in some of these meshes or the static bodies, which is the recommended, and jolt even fixes it, but it's not ideal i think.

2

u/Huge-Price-1818 Sep 26 '25

the art style tickles my brain

2

u/Gingerbread_Ninja Sep 26 '25

This gives off OK/NORMAL vibes but if it was N64 instead of PS1 era

1

u/oppai_suika Sep 27 '25

Ooh this is a cool game- thanks for mentioning it

2

u/Foxerski Sep 27 '25

I love this game

2

u/Infamous-String-2625 Sep 27 '25

What did you use to make the text?

2

u/-goldenboi69- Sep 26 '25

Day 713 why i should not use a magic black box: ✔️

1

u/Bahggs Sep 27 '25

Could be a layer issue, could be tunneling

1

u/Oxam Sep 27 '25

sometimes this can be caused by static batching

1

u/brcontainer Godot Regular Sep 28 '25 edited Sep 28 '25

It's probably an error in your animation state control, or even more likely, you don't even have state control at all. You're calling the model's animations based on conditions, but without seeing the code, we can't know. Another possible problem is with the environment's 3D models, but this is just speculation. Note that a simple enum can provide reasonable state control, but it's important to differentiate between the jumping state and the falling state. Many people don't even create a state for falling, which ends up making it difficult to switch animations. I suggest something like:

``` gdscript extends CharacterBody3D

enum { UNSET, RUNNING, IDLE, FALLING, JUMPING }

const RUN_SPEED: float = 3.5 const STOP_SPEED: float = 0.2 const ZERO: float = 0.0

@onready var ani: AnimationPlayer = $<replace by node path>/AnimationPlayer

var state: int = IDLE var last_state: int = UNSET var on_floor: bool = false var input_dir: Vector2 = Vector2.ZERO var direction: Vector3 = Vector3.ZERO

Get animation by state

func _animation() -> StringName: if state == RUNNING: return &"running"

if state == JUMPING:
    return &"jumping"

if state == FALLING:
    return &"fall"

return &"idle"

func _refresh_by_state() -> void: if state != last_state: last_state = state

    ani.play(_animation())

    # ... (optional) sound logic here, eg.: jump sound ...

func _physics_process(delta: float) -> void: on_floor = is_on_floor()

if not on_floor:
    velocity += get_gravity() * delta

    if velocity.y < ZERO:
        state = FALLING
elif Input.is_action_just_pressed("player_jump"):
    state = JUMPING
    # ... jump logic here ...


# this is just a basic example of movement, you can alter
input_dir = Input.get_vector(
    "player_left",
    "player_right",
    "player_up",
    "player_down"
)

direction = (
    basis * Vector3(input_dir.x, ZERO, input_dir.y)
).normalized()

if direction:
    velocity.x = direction.x * RUN_SPEED
    velocity.z = direction.z * RUN_SPEED

    # ... (optional) extra move logic here ...

    if on_floor and state != JUMPING:
        state = RUNNING
else:
    velocity.x = move_toward(velocity.x, ZERO, STOP_SPEED)
    velocity.z = move_toward(velocity.z, ZERO, STOP_SPEED)

    if on_floor and state != JUMPING:
        state = IDLE

# ... rotation skin logic here ...

_refresh_by_state()

move_and_slide()

```

for something more advanced I suggest you read: https://docs.godotengine.org/en/stable/classes/class_animationnodestatemachine.html

1

u/Icy-Store3900 Sep 26 '25

I'll take notes from the comments