Hello! I have two large issues in a fairly simple codebase (200lines of code). I wish to use SI units in this system, that is when I render rectangles, I want to use 1.0 as 1 meter.
I spawn a rectangle, surrounded by rectangles in a circle, but no boxes are shown.
code:
commands.spawn((
Camera2dBundle {
projection: OrthographicProjection {
scale: 0.1,
..default()
}
..default()
},
));
// Rectangle representing the center
commands
.spawn((
SpriteBundle {
sprite: Sprite {
color: Color::ORANGE,
custom_size: Some(Vec2::new(12.0, 1.0)),
..default()
},
transform: Transform::from_translation(Vec3::new(0., 0., 3.)).with_scale(Vec3::ONE),
..default()
},
))
.with_children(|parent| {
for dir in 0..directions {
//omitted code for charactedlimit
let mut transform = Transform::from_translation(Vec3::new(dist, 0., 33.)).with_scale(Vec3::ONE);
transform.rotate_around(Vec3::ZERO, Quat::from_rotation_z(rad));
// Rectangle
parent.spawn((
Bar,
SensorBundle {
collider: Collider::cuboid(width / 2., height / 2.),
..default()
},
SpriteBundle {
sprite: Sprite {
color: Color::YELLOW,
custom_size: Some(Vec2::new(width, height)),
..default()
},
transform,
..default()
},
));
}
}
});