new projectile models
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -19,6 +19,7 @@ use lightyear::prelude::{NetworkTarget, Replicate};
|
||||
use std::f32::consts::PI;
|
||||
|
||||
const MAX_SHOT_AGES: f32 = 15.;
|
||||
const MISSLE_SPEED: f32 = 3.;
|
||||
|
||||
#[derive(Component)]
|
||||
struct MissileProjectile {
|
||||
@@ -97,8 +98,7 @@ fn on_trigger_missile(
|
||||
transform,
|
||||
children![
|
||||
(
|
||||
Transform::from_rotation(Quat::from_rotation_x(PI / 2.).inverse())
|
||||
.with_scale(Vec3::splat(0.04)),
|
||||
Transform::from_rotation(Quat::from_rotation_x(PI / 2.).inverse()),
|
||||
GltfSceneRoot::Projectile("missile".to_string()),
|
||||
),
|
||||
(
|
||||
@@ -125,7 +125,7 @@ fn on_trigger_missile(
|
||||
fn update(mut query: Query<&mut Transform, With<MissileProjectile>>) {
|
||||
for mut transform in query.iter_mut() {
|
||||
let forward = transform.forward();
|
||||
transform.translation += forward * 3.;
|
||||
transform.translation += forward * MISSLE_SPEED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user