Recovering deleted assets

The entity part was deleted in my project, can I get it back?
Or do I have a chance to get my codes from the part where I created my project.

If you are using checkpoints with version it is possible restore via a few steps:

  • Create a checkpoint of your current work (A)
  • Restore an older checkpoint that has the entity
  • Copy and paste the entity from this project to another project
  • Restore checkpoint A
  • Copy and paste the entity from the other project to your current project

Is it the asset that was deleted or the entity in the hierarchy?

Are you using version control too?

Deleted assets

Were you using version control? Do you have a checkpoint that had the asset?

There’s no easy way to restore the asset but it may be possible to create a copy of it again and re-add to the project.

No version control point unfortunately

Then unfortunately it is not possible to bring back the asset. You will have to remake it/reupload and configure it.

I shared my project or we can’t get it from there.

What do you mean by ‘shared my project’?

Buradan bulma şansımız varmı

If the asset is in that project, you can copy and paste assets between projects you have access to:

https://developer.playcanvas.com/en/user-manual/designer/assets/#copy-and-paste-between-projects

thank you

However, if you have only shared a build of the game, you can’t really get the asset from the build.

You can only copy and paste between Editor projects

can’t i get my codes

[image]

The image was not attached, can you try again please?

Can we get the codes in this project

Because it is an exported project, the best you can get from it is the minified code files

ie: https://s3-eu-west-1.amazonaws.com/apps.playcanvas.com/oGq3pHMV/__game-scripts.js

var Controller = pc.createScript("controller");
Controller.attributes.add("speed", {
    type: "number",
    default: 3
}),
Controller.attributes.add("direction_speed", {
    type: "number",
    default: 17
}),
Controller.attributes.add("count", {
    type: "number",
    default: 2
}),
Controller.attributes.add("countText", {
    type: "entity"
}),
Controller.attributes.add("sceneId", {
    type: "string",
    default: "0",
    title: "Scene ID to Load"
}),
Controller.attributes.add("sceneIdd", {
    type: "string",
    default: "0",
    title: "Game Over"
}),
Controller.prototype.initialize = function() {
    this.entity.collision.on("collisionstart", this.onCollisionStart, this),
    this.countText.element.text = this.count,
    this.sagButton = this.app.root.findByName("SagButton"),
    this.solButton = this.app.root.findByName("SolButtton"),
    this.isSagPressed = !1,
    this.isSolPressed = !1,
    this.sagButton.element.off("mousedown"),
    this.sagButton.element.off("mouseup"),
    this.sagButton.element.off("touchstart"),
    this.sagButton.element.off("touchend"),
    this.solButton.element.off("mousedown"),
    this.solButton.element.off("mouseup"),
    this.solButton.element.off("touchstart"),
    this.solButton.element.off("touchend"),
    this.sagButton.element.on("mousedown", this.onSagDown, this),
    this.sagButton.element.on("mouseup", this.onSagUp, this),
    this.sagButton.element.on("touchstart", this.onSagDown, this),
    this.sagButton.element.on("touchend", this.onSagUp, this),
    this.solButton.element.on("mousedown", this.onSolDown, this),
    this.solButton.element.on("mouseup", this.onSolUp, this),
    this.solButton.element.on("touchstart", this.onSolDown, this),
    this.solButton.element.on("touchend", this.onSolUp, this)
}
,
Controller.prototype.onSagDown = function(t) {
    this.isSagPressed = !0
}
,
Controller.prototype.onSagUp = function(t) {
    this.isSagPressed = !1
}
,
Controller.prototype.onSolDown = function(t) {
    this.isSolPressed = !0
}
,
Controller.prototype.onSolUp = function(t) {
    this.isSolPressed = !1
}
,
Controller.prototype.onCollisionStart = function(t) {
    t.other.tags.has("iki") && 2 == this.count && (t.other.destroy(),
    this.count = 4,
    this.countText.element.text = +this.count),
    t.other.tags.has("dört") && 4 == this.count && (t.other.destroy(),
    this.count = 8,
    this.countText.element.text = this.count),
    t.other.tags.has("sekiz") && 8 == this.count && (t.other.destroy(),
    this.count = 16,
    this.countText.element.text = this.count),
    t.other.tags.has("onalti") && 16 == this.count && (t.other.destroy(),
    this.count = 32,
    this.countText.element.text = this.count),
    t.other.tags.has("otuziki") && 32 == this.count && (t.other.destroy(),
    this.count = 64,
    this.countText.element.text = this.count),
    t.other.tags.has("altmışdört") && 64 == this.count && (t.other.destroy(),
    this.count = 64,
    this.countText.element.text = this.count);
    var e = this.app.root.findByName("Root");
    t.other.tags.has("serigec") && 2 == this.count && (e.destroy(),
    this.loadScene(this.sceneId, (function() {}
    ))),
    t.other.tags.has("serigecdört") && 4 == this.count && (e.destroy(),
    this.loadScene(this.sceneId, (function() {}
    ))),
    t.other.tags.has("serigecsekiz") && 8 == this.count && (e.destroy(),
    this.loadScene(this.sceneId, (function() {}
    ))),
    t.other.tags.has("serigeconalti") && 16 == this.count && (e.destroy(),
    this.loadScene(this.sceneId, (function() {}
    ))),
    t.other.tags.has("serigecotuziki") && 32 == this.count && (e.destroy(),
    this.loadScene(this.sceneId, (function() {}
    ))),
    t.other.tags.has("serigecaltmisdört") && 64 == this.count && (e.destroy(),
    this.loadScene(this.sceneId, (function() {}
    ))),
    t.other.tags.has("deneme") && 2 == this.count && (t.other.destroy(),
    e.destroy(),
    this.loadScene(this.sceneIdd, (function() {}
    ))),
    t.other.tags.has("deneme") && 4 == this.count && (this.count = 2,
    this.countText.element.text = this.count,
    t.other.destroy()),
    t.other.tags.has("deneme") && 8 == this.count && (this.count = 4,
    this.countText.element.text = this.count,
    t.other.destroy()),
    t.other.tags.has("deneme") && 16 == this.count && (this.count = 8,
    this.countText.element.text = this.count,
    t.other.destroy()),
    t.other.tags.has("deneme") && 32 == this.count && (this.count = 16,
    this.countText.element.text = this.count,
    t.other.destroy()),
    t.other.tags.has("deneme") && 64 == this.count && (this.count = 32,
    this.countText.element.text = this.count,
    t.other.destroy())
}
,
Controller.prototype.update = function(t) {
    var e = this.entity.rigidbody
      , o = this.entity.rigidbody
      , s = 0
      , n = 0;
    (this.app.keyboard.isPressed(pc.KEY_LEFT) || this.isSolPressed) && (n = 1),
    (this.app.keyboard.isPressed(pc.KEY_RIGHT) || this.isSagPressed) && (n = -1),
    this.speed <= 3 ? s = -1 : this.speed = 3;
    var i = new pc.Vec3(s,0,0);
    e.applyForce(i.scale(this.speed));
    var h = new pc.Vec3(0,0,n);
    o.applyForce(h.scale(this.direction_speed));
    var r = this.app.root.findByName("Sound");
    this.app.keyboard.isPressed(pc.KEY_P) && (r.sound.stop("engel"),
    r.sound.play("top")),
    this.app.keyboard.isPressed(pc.KEY_O) && (r.sound.stop("top"),
    r.sound.play("engel"))
}
,
Controller.prototype.loadScene = function(t, e) {
    var o = t + ".json";
    this.app.loadSceneHierarchy(o, (function(t, o) {
        t ? console.error(t) : e(o)
    }
    ))
}
;
var CameraController = pc.createScript("cameraController");
CameraController.attributes.add("Sphere", {
    type: "entity"
}),
CameraController.attributes.add("offset", {
    type: "vec3"
}),
CameraController.prototype.initialize = function() {
    this.offset = this.entity.getPosition().sub(this.Sphere.getPosition())
}
,
CameraController.prototype.update = function(t) {
    this.entity.setPosition(this.Sphere.getPosition().add(this.offset))
}
;
var ChangingScenes = pc.createScript("changingScenes");
ChangingScenes.attributes.add("sceneId", {
    type: "string",
    default: "0",
    title: "Scene ID to Load"
}),
ChangingScenes.prototype.initialize = function() {
    this.entity.element.on("mouseente", this.onEnter, this),
    this.entity.element.on("mousedown", this.onPress, this),
    this.entity.element.on("mouseup", this.onRelease, this),
    this.entity.element.on("mouseleave", this.onLeave, this),
    this.entity.element.on("touchstart", this.onPress, this),
    this.entity.element.on("touchend", this.onRelease, this)
}
,
ChangingScenes.prototype.onPress = function(e) {
    this.app.root.findByName("Root").destroy(),
    this.loadScene(this.sceneId, (function() {}
    ))
}
,
ChangingScenes.prototype.update = function(e) {}
,
ChangingScenes.prototype.loadScene = function(e, t) {
    var n = e + ".json";
    this.app.loadSceneHierarchy(n, (function(e, n) {
        e ? console.error(e) : t(n)
    }
    ))
}
;
var NewLevel = pc.createScript("newLevel");
NewLevel.attributes.add("sceneIdd", {
    type: "string",
    default: "0",
    title: "Game Over"
}),
NewLevel.attributes.add("count", {
    type: "number",
    default: 2
}),
NewLevel.attributes.add("countText", {
    type: "entity"
}),
NewLevel.attributes.add("winText", {
    type: "entity"
}),
NewLevel.prototype.initialize = function() {
    this.entity.collision.on("collisionstart", this.onCollisionStart, this)
}
,
NewLevel.prototype.onCollisionStart = function(e) {
    e.other.tags.has("gameoverkatman") && (this.app.root.findByName("Root").destroy(),
    this.loadScene(this.sceneIdd, (function() {}
    )))
}
,
NewLevel.prototype.loadScene = function(e, t) {
    var o = e + ".json";
    this.app.loadSceneHierarchy(o, (function(e, o) {
        e ? console.error(e) : t(o)
    }
    ))
}
;
var Rotate = pc.createScript("rotate");
Rotate.prototype.initialize = function() {}
,
Rotate.prototype.update = function(t) {
    this.entity.rotate(new pc.Vec3(0,90,0).scale(t))
}
;
var GameOver = pc.createScript("gameOver");
GameOver.attributes.add("sceneIdd", {
    type: "string",
    default: "0",
    title: "Game Over"
}),
GameOver.prototype.initialize = function() {
    this.entity.collision.on("collisionstart", this.onCollisionStart, this)
}
,
GameOver.prototype.onCollisionStart = function(e) {
    e.other.tags.has("gameoverkatman") && (this.app.root.findByName("Root").destroy(),
    this.loadScene(this.sceneIdd, (function() {}
    )))
}
,
GameOver.prototype.loadScene = function(e, t) {
    var o = e + ".json";
    this.app.loadSceneHierarchy(o, (function(e, o) {
        e ? console.error(e) : t(o)
    }
    ))
}
;
var Playsound = pc.createScript("playsound");
Playsound.prototype.initialize = function() {}
,
Playsound.prototype.update = function(o) {
    var p = this.app.root.findByName("Sound");
    this.app.keyboard.isPressed(pc.KEY_P) && p.sound.play("top")
}
;

Controller.prototype.onCollisionStart = function(t) {
t.other.tags.has(“iki”) && 2 == this.count && (t.other.destroy(),
this.count = 4,
this.countText.element.text = +this.count),
t.other.tags.has(“dört”) && 4 == this.count && (t.other.destroy(),
this.count = 8,
this.countText.element.text = this.count),
t.other.tags.has(“sekiz”) && 8 == this.count && (t.other.destroy(),
this.count = 16,
this.countText.element.text = this.count),
t.other.tags.has(“onalti”) && 16 == this.count && (t.other.destroy(),
this.count = 32,
this.countText.element.text = this.count),
t.other.tags.has(“otuziki”) && 32 == this.count && (t.other.destroy(),
this.count = 64,
this.countText.element.text = this.count),
t.other.tags.has(“altmışdört”) && 64 == this.count && (t.other.destroy(),
this.count = 64,
this.countText.element.text = this.count);

What should be the places where ‘t’ is written in this code

t would be a local variable that was minimised during the build process to reduce the file size of the script. So it could be anything. In this case, t looks like it would be a collision event given that this is a callback function for a collision.