camera shaking good
This commit is contained in:
parent
ee8799c324
commit
329cd173b9
3 changed files with 4 additions and 2 deletions
|
|
@ -13,7 +13,7 @@ pub struct MyCamera {
|
|||
pub fn spawn_camera(mut commands: Commands) {
|
||||
let mycam = commands
|
||||
.spawn((
|
||||
MyCamera { shaking_intensity_factor: 10.0, shaking_reset_speed: 0.1 },
|
||||
MyCamera { shaking_intensity_factor: 10.0, shaking_reset_speed: 100.0 },
|
||||
Transform::from_translation(Vec3::ZERO),
|
||||
))
|
||||
.id();
|
||||
|
|
@ -39,7 +39,7 @@ pub fn camera_shake(
|
|||
child_translation -= child_translation * parent.shaking_reset_speed * time.delta_secs();
|
||||
child_transform.translation.x = child_translation.x;
|
||||
child_transform.translation.y = child_translation.y;
|
||||
// println!("{:?}", child_transform.translation);
|
||||
println!("{:?}", child_transform.translation);
|
||||
}
|
||||
|
||||
pub struct MyCameraPlugin;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue