How to cut objects with other objects?

Is there a way to cut/delete parts of objects using the collision box of another object?

0001-0060

Like this?

And before anyone says it, no I don’t want to MASK it, I want to delete it. If masking is the only option then I’ll have to try it.

No, you cannot deform 2D objects in that way, other than via masks.

Object masking hides portions or changes its opacity. The Marching Squares extension allows you to modify the object including the hit box.

See the a platformer with destructible platforms example.

https://wiki.gdevelop.io/gdevelop5/extensions/marching-squares/details/

Can the mask at least make the object part transparent? Like can I mask part of the object to be transparent and not affect the foreground or background?

Masks are exclusively “per object”. Unless your foreground or background are the exact same object, they will only impact that one object.

SUPER sorry, I MEANT how do I cut objects and have them fall?

Like this

Stick Suicide

You don’t. The closest you might be able to get is with the marching squares extension and the slice into pieces extension, but I don’t know that they’ll be exact like that.

How close is this to what you want? Exactly or just an example?

For this, you could use broken smaller physics objects and apply some form of force to them. I think there’s also an extension to help with the explosion force part. IDK if you could arrange them seemlessly. I guess you could play with the physics settings, layers or mask so the objects could overlap.

There’s also a slice extension but that replaces an object with square shaped pieces.

1 Like

You guys know how the above image got it to work at all?

Its a 3D game with a deformation and polygon decomposition algorithm/engine/etc.

You can even see the gun z layer-fighting with the stickman.

Hmm, well seems my only viable option is to mask out part of the object as soon as its impacted and put a bunch of pieces in the same spot as the damaged area, and force them into the desired angle to simulate it. Might be better for performance anyway since I want it to be multiplayer.