How to make it visible only on obstacles

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By HorseGorilla

Hello guys, I was making a pit. The pit is a single sprite(one frame), and I want to make it slowly fall out when the player or enemy enters it, but is there a way to make the part outside the pit invisible? pit’s Area2D node. Without it, I wonder how to make it efficient and impressive. Thanks for the advice.

link of image
https://drive.google.com/file/d/1uJ-fb8SF7nSZEEIFgu2SNdLvgyE5EXkJ/view?usp=sharing

You can probably use a shader to do this, but I’m not exactly sure what you mean by the part outside the pit. Can you show an image?

exuin | 2021-05-26 05:37

Sorry, I just upload link of image.

HorseGorilla | 2021-05-26 11:36

You can use an image-editing software to remove the background of your image.

exuin | 2021-05-26 16:10

This is already removed the background, What I’m wondering is, is there a way to make this pit fall when a player or enemy comes in contact and make the player or enemy sprite invisible, starting at the foot? Or do you have to do it like you’re going to get rid of the whole? Sorry I’m not good at English and I used to translation

HorseGorilla | 2021-05-26 16:48

I think you can use a shader like this one.

exuin | 2021-05-26 17:28

Thank you, I will use it

HorseGorilla | 2021-05-27 03:58