always make sure camera z is at 999, make sure character z at least at 1
This commit is contained in:
parent
135fc268aa
commit
972cd26876
1 changed files with 4 additions and 1 deletions
|
@ -113,9 +113,11 @@ pub fn spawn_character(
|
||||||
selected_character_id: &mut Mut<SelectedCharacterId>,
|
selected_character_id: &mut Mut<SelectedCharacterId>,
|
||||||
character_id_list: &mut Mut<CharacterIdList>,
|
character_id_list: &mut Mut<CharacterIdList>,
|
||||||
audio: &Res<crossbeam_channel::Sender<AudioMsg>>,
|
audio: &Res<crossbeam_channel::Sender<AudioMsg>>,
|
||||||
transform: Transform,
|
mut transform: Transform,
|
||||||
color: Color,
|
color: Color,
|
||||||
) {
|
) {
|
||||||
|
transform.translation.z = transform.translation.z.max(1.0);
|
||||||
|
|
||||||
let character_id = CharacterId(
|
let character_id = CharacterId(
|
||||||
character_id_list
|
character_id_list
|
||||||
.0
|
.0
|
||||||
|
@ -325,6 +327,7 @@ fn move_camera(
|
||||||
camera_transform.translation = camera_transform.translation.lerp(transform.translation, time.delta_seconds() * FOLLOW_SPEED);
|
camera_transform.translation = camera_transform.translation.lerp(transform.translation, time.delta_seconds() * FOLLOW_SPEED);
|
||||||
// prevent camera from going too low
|
// prevent camera from going too low
|
||||||
camera_transform.translation.y = camera_transform.translation.y.max(half_height-MARGIN);
|
camera_transform.translation.y = camera_transform.translation.y.max(half_height-MARGIN);
|
||||||
|
camera_transform.translation.z = 999.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue