I’m wanting to create a waterfall in the foreground that uses the displacement effect, where the player sprite is distorted only when walking behind the waterfall. Is this possible?
Currently I have a waterfall sprite with the displacement effect applied to it, using a basic water displacement texture. It’s on the same layer as the player, just using a higher Z order. When walking behind the waterfall, the player of course is not distorted by the displacement effect.
Unfortunately there’s no such post-processing effects in GD… the best you could do with built in methods would be to apply the distortion to a whole layer, then move objects on and off that layer to switch the effect. However this would still include the whole object so wouldn’t look good if your object was half-way behind the effect. I guess for thin objects you could check if the object is fully inside, but that’s still kinda crap.
There is action to enable/disable object effect
So you can enable it when player is behind waterfall and disable it when he is not
Only issue you will have you cannot enable/disable it partially
So if part of player is under waterfall and part is not
You can have it either on or off
But not partially on and off