摄像机跟着物体移动
摄像机放在主角的节点下也可以实现
用代码实现
摄像机的脚本
@property(Node)
target: Node
@property(Vec3)
offset: Vec3 = new Vec3();
tmpPos = new Vec3();
update(deltaTime: number) {
this.target.getPosition(this.tmpPos);
this.tmpPos.add(this.offset)
this.node.position = this.tmpPos
}
1.跟随的物体
2.相机的角度