13 lines
No EOL
310 B
GDScript
13 lines
No EOL
310 B
GDScript
extends RigidBody
|
|
|
|
var hit_timer = 0
|
|
|
|
func _process(delta):
|
|
if hit_timer >0:
|
|
hit_timer -= delta
|
|
if hit_timer <= 0:
|
|
$MeshInstance.get_surface_material(0).albedo_color = Color(1,1,1,1)
|
|
|
|
func hit():
|
|
$MeshInstance.get_surface_material(0).albedo_color = Color(1,0,0, 1)
|
|
hit_timer = 1 |