canals elevator

This commit is contained in:
2025-03-20 23:44:03 +01:00
parent 203819eb40
commit 9e8485d3a3
2 changed files with 31 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ fn init(
continue;
};
let target = Vec3::new(transform.translation.x, target.y, transform.translation.z);
let platform = ActivePlatform {
start: transform.translation,
target,
@@ -42,7 +43,7 @@ fn init(
fn move_active(time: Res<Time>, mut platforms: Query<(&mut Transform, &mut ActivePlatform)>) {
for (mut transform, active) in platforms.iter_mut() {
let t = (sin(time.elapsed_secs() * 0.5) + 1.) / 2.;
let t = (sin(time.elapsed_secs() * 0.4) + 1.) / 2.;
transform.translation = active.start.lerp(active.target, t);
}