Let's say we have this code snippet
use avian2d::prelude::*;
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins((DefaultPlugins, PhysicsPlugins::default()))
.add_systems(Startup, setup)
.run();
}
fn setup(mut commands: Commands) {
commands.spawn((
Transform {
translation: Vec3::ZERO,
rotation: Quat::IDENTITY,
scale: vec3(50.0, 50.0, 0.0),
},
RigidBody::Dynamic,
Collider::circle(50.0),
ColliderDensity(1.0),
));
}
Running this code snippet we get
avian2d::dynamics::rigid_body::mass_properties: Dynamic rigid body 84v0 has no mass or inertia. This can cause NaN values. Consider adding a MassPropertiesBundle or a Collider with mass.
However, this is misleading as we have a mass. The actual problem is the fact that the z scale is 0. I think the library should warn the user when the z scale is 0.
Let's say we have this code snippet
Running this code snippet we get
However, this is misleading as we have a mass. The actual problem is the fact that the z scale is 0. I think the library should warn the user when the z scale is 0.