giants-godot/addons/decals/SetStartTimeOnDecal.gd

12 lines
267 B
GDScript3
Raw Normal View History

2021-10-10 15:51:46 +02:00
tool
extends MeshInstance
# use this script on one shot flipbook animations
func _ready():
var cur_time = OS.get_ticks_msec() / 1000.0
var mat = get_surface_material(0).duplicate(true)
set_surface_material(0, mat)
mat.set_shader_param("start_time", cur_time)