Camera follow Player – #3 by phung179 – Cocos Creator



i want the camera follow my player but it’s can’t , here my code

update (dt) {

     let target = this.Player.getPosition();

     let curPos = this.node.getPosition();

     curPos.lerp(target, 0.1, curPos);

     this.node.setPosition(curPos);
},



Source link

More To Explore

Share on facebook
Share on twitter
Share on linkedin
Share on email