![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Shlopynoobnoob |
I want to blur the scene when the game is over.
this is the shader script:
shader_type canvas_item;
uniform float blur_amount : hint_range(0, 5);
void fragment() {
COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount);
}
I put the shader in a control node.
this is the gdscript that I assigned to the main node:
extends Node2D
onready var blur = $blur
var blur_amount = 0
func _process(delta):
if $bar.value == 0:
game_over()
func game_over():
blur.material.set_shader_param("blur_amount", 5)
but it’s not working