shader_type canvas_item;

uniform vec2 player_pos = vec2(0);
uniform vec2 world_offset = vec2(0);
uniform float interact_power = 8;
uniform float radius = 30;

void vertex() {
	vec2 world_vert = VERTEX + world_offset; // model space to world space
	vec2 direction = world_vert - player_pos;
	direction.y = 0.0;
	direction = normalize(direction);
	float dist = distance(player_pos, world_vert);
	float power = smoothstep(radius, 0.0, dist);
	VERTEX -= direction * power * interact_power * (1.0 - UV.y);
}