godotengine / godotengine/godot

Odd Rigidbody collisions against static body trimesh used in gridmap

Open
#87,204 0 comments 1 reaction 0 assignees View on GitHub
bug needs testing topic:physics
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Reproducible in v4.1.2.stable.official [399c9dc39]

### System information

Windows 10 - Godot v4.1.2.stable.official [399c9dc39]

### Issue description

While moving across a flat plane created using gridmap filled with simple boxshape tilesets, the rigidbody collides with the border of the tiles, causing the rigidbody to jump up, get moved to the side, or in the worst cases seems to be unable to crossover the edge along several tiles in a specific axis unless the rigidbody pushes past it with sufficient force or just hops over it.

### Steps to reproduce

create a boxshape mesh and then use the 'Mesh' button at the top of the viewport to create a trimesh static body. Turn that into a Tileset and then use it to make a flat floor in a Gridmap. Create a rigidbody player, have the camera and rigidbody rotate based on mouse movement and control it to move on the flat plane.

In the MRP I've provided, I've essentially setup 2 rows of tiles that the rigidbody can walk on and the ability to direct the rigidbody towards the direction where the camera is pointing. Just moving forward with 'w', the rigidbody will slowly get pushed off the tiles.
To recreate the third case where the rigidbody can't move past the edge along a specific axis, you need to move forward on one row and slightly tilt the camera towards the other row, the camera will rotate correctly but the rigidbody won't be able to cross the boundary to the other row and just rides against it until it hits a bump which forces the rigidbody to hop over the edge, or the camera is rotated further towards the other row. I'm assuming that the rigidbody created does not have enough force to move against the edge between the two rows until the camera is turned to a certain point.

### Minimal reproduction project (MRP)

[3DPlatformer - Copy.zip](https://github.com/godotengine/godot/files/13935205/3DPlatformer.-.Copy.zip)

Contributor guide

Open the contributing guide

Research direction

Open the linked Minimal Reproduction Project and follow the GridMap, trimesh static body, and Rigidbody setup described in the issue. Investigate the collision behavior while crossing tile boundaries; done means the Rigidbody can traverse the flat tiled floor without being pushed aside, jumping, or becoming stuck at tile edges.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.