Godot Version
4.6.1
Question
basically i’m trying to do this to my cabal of planemeshes:
but instead my code does this:
the code in question:
func _process(delta: float) -> void:
for p in get_children():
var ry = rad_to_deg(p.global_rotation.y)
var rx = rad_to_deg(p.global_rotation.x)
var darkening = 0.0
if ry>150 or rx>150:
darkening = 0.4
elif ry>100 or rx>100:
darkening = 0.2
p.get_active_material(0).emission = colors[p.color_id].darkened(darkening)
^the cabal in question
code of the root CollectibleDiamond node:
extends Area3D
@export var type : Globals.collectible_types = Globals.collectible_types["DIAMOND"]
@export var id : int = 0
func _ready() -> void:
if type == Globals.collectible_types["DIAMOND"] and ProgressTracker.diamond_list[id]==true:
queue_free()
func _process(delta: float) -> void:
$Model.rotation.y+=1.7*delta


