Gravity above objects is inverted when the character moves (sometimes, I can't tell exactly when).
This is my code, I'm trying to make a rigid platform to test things on:
pub fn setup_terrain(mut commands: Commands, mut meshes: ResMut<Assets<Mesh>>, mut materials: ResMut<Assets<ColorMaterial>>, windows: Query<&Window>) {
let window = windows.single();
let width = window.width();
let rect = Mesh2dHandle(meshes.add(Rectangle::new(width, 32.)));
let color = Color::linear_rgb(1., 1., 0.);
commands.spawn((
MaterialMesh2dBundle {
mesh: rect,
material: materials.add(color),
transform: Transform::from_xyz(0., -32., 0.),
..default()
},
Collider::rectangle(width, 32.),
RigidBody::Static
));
}
Gravity above objects is inverted when the character moves (sometimes, I can't tell exactly when). This is my code, I'm trying to make a rigid platform to test things on:
And the player...
Is this a bug? Or is it just my code? The character floats up until a certain point, and then stops floating automatically unless I move it.