treadmill shader fix

previously when adjusting the value of the shader, it would change the value for all shaders.

now it duplicates the shader at runtime so it's a unique copy and can have it's own unique shhader value
This commit is contained in:
Harmony Monroe 2020-10-05 13:48:05 -04:00
parent 5f476210ff
commit 8c9c34f33a
4 changed files with 39 additions and 10 deletions

View file

@ -8,10 +8,14 @@ export var editor_move := 0 setget _set_editor_move
var node_sprite : Sprite
func _ready():
# editor and game code
node_sprite = $Sprite
node_sprite.material = node_sprite.material.duplicate(true)
#node_sprite.material = node_sprite.get_material().duplicate(true)
#node_sprite.set_material(node_sprite.get_material().duplicate(true))
print(node_sprite.material)
_set_tread_speed(tread_speed)
_set_length(length)