Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import { UniversalCamera, Mesh } from "@babylonjs/core";
import {gsap } from "gsap";
import {fromScene} from "../tools";
export default class CameraComponent extends UniversalCamera {
@fromScene("node-0_primitive13")
private _wall13 : Mesh;
public onStart(): void {
var tl = gsap.timeline({repeat: 2, repeatDelay: 1});
tl.to(this.position, {x:0,y:6,z: 20, duration: 3}); // leave from the "_wall13 during 3 sec"
tl.to(this.position, {x:-9,y:3,z: 7, duration: 5}); // approaching the "_wall13 during 5 sec"
this.lockedTarget = this._wall13;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment