Hello all, I was just testing out a new script when playcanvas crashed, not just the launch tab, but the editor and code interface tabs as well.
Here is the new code I was testing:
var Dummy = pc.createScript('dummy');
let moving2 = false;
// initialize code called once per entity
Dummy.prototype.initialize = function() {
this.point4 = new pc.Vec3(0.5,0.5,0.5);
this.targetPosition3 = new pc.Vec3 (this.point4.x,this.point4.y,this.point4.z);
this.lerpedPosition = new pc.Vec3 ();
};
// update code called every frame
Dummy.prototype.update = function(dt) {
while(this.entity.getPosition.x != this.point4.x && this.entity.getPosition.y != this.point4.y && this.entity.getPosition.z != this.point4.z){
//if(this.app.keyboard.isPressed(pc.KEY_1)){
// Lerp the current position and the target position
this.lerpedPosition.lerp (this.entity.getLocalPosition (), this.targetPosition3, this.speed * dt);
// Update the entity's position to the lerped position
this.entity.setLocalPosition (this.lerpedPosition);
};
};
// uncomment the swap method to enable hot-reloading for this script
// update the method body to copy state from the old instance
// Dummy.prototype.swap = function(old) { };
// learn more about scripting here:
// https://developer.playcanvas.com/user-manual/scripting/
Here is the link to my project: PlayCanvas 3D HTML5 Game Engine
Scene is “Glacius”