Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Last active September 21, 2020 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/772eb739b26a1005dae7383f0e2ce903 to your computer and use it in GitHub Desktop.
Save flushpot1125/772eb739b26a1005dae7383f0e2ce903 to your computer and use it in GitHub Desktop.
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