canals elevator
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user