Create a stepping stone that breaks when stepped on it
Place objects wherever you want
Create a stepping stones and rename the title of the stones that should disappear.
![breakable-platform_deploy](/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fbreakable-platform_deploy.50d060b2.png&w=2048&q=75)
🚫
Don’t forget to check Body in the object’s properties panel to use methods
like onCollide
!
![snippet_physics-body](/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fsnippet_physics-body.a07c5968.png&w=1920&q=75)
Code
const falseboxes = [];
for (let i = 0; i < 5; i++) {
falseboxes[i] = WORLD.getObject("falsebox_" + i);
}
function Start() {
falseboxes.forEach((box) => {
box.onCollide(PLAYER, () => {
box.kill();
setTimeout(() => {
box.revive();
}, 1000);
});
});
}
![breakable-platform_result](/images/snippet/event/breakable-platform/breakable-platform_result.gif)
Result