Wiggle 2D
Wiggles an element. You can change random offset in code if you are using it on multiple objects and need them to wiggle independantly, just remember to make a new material for each element if doing so.
Shader code
shader_type canvas_item;
uniform float Strength : hint_range(0,20) = 5;
uniform float RandomOffset = 1.0;
float random( float seed )
{
return fract( 543.2543 * sin( dot( vec2( seed, seed ), vec2( 3525.46 + RandomOffset, -54.3415 ) ) ) );
}
void vertex()
{
vec2 VERTEX_OFFSET = VERTEX;
VERTEX_OFFSET.x += (
random(
( trunc( VERTEX_OFFSET.y))
+ TIME
) - 0.5
) * Strength ;
VERTEX_OFFSET.y += (
random(
( trunc( VERTEX_OFFSET.x))
+ TIME
) - 0.5
) * Strength;
VERTEX = VERTEX_OFFSET;
}
This is awesome! How would I slow down the rate of wiggling?
I don’t have a concrete solution as I’m not that experienced with shaders, but you could most likely achieve this by removing TIME and replace with a variable updated through a script, and then updating that variable at the desired interval to the current runtime
wish you made one for warping.