This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

If I use the color change function at startup, everything works. And if I send a signal that should do this function, it does it, but the color does not change.

Here is my code. (This object is prefab)

extends Spatial

onready var tween := $Tween
var colors:Array = [Color.white,,,, Color.aqua, Color.blueviolet]
var stat:int = 0
var is_merge:bool = false

func _ready():
    $"..".connect("spawn", self, "_on_Bomb_spawn")
    $"..".connect("set_color", self, "_set_color")
    tween.interpolate_property($".", "translation:y", 2, 1.4, 0.2)

func set_color() -> void:
    $BombMesh.get_surface_material(0).albedo_color = colors[stat]

func _set_color() -> void:
Godot version 3.3.3
in Engine by (34 points)

1 Answer

0 votes

I myself solved this problem by typing. You need to check the box here.

by (34 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.