Godot Version
4.2.2 Stable
Question
When i run the scene the Exported var disapears and resets to the initial value, until i edit the code. What did i do wrong?
here is the code:
extends Node3D
@export_range(10,360) var spinSpeed :int
var rotSpeed := Vector3(0,spinSpeed,0)
var coin : Node3D
func get_Node() -> Node3D:
for child in get_children() :
print(child)
if child is Node3D:
return child
return null
func _ready():
print(spinSpeed)
coin = get_Node()
coin.set_rotation_degrees(Vector3(90,0,0))
func _process(delta):
var ro : Vector3 = coin.get_rotation_degrees() + rotSpeed * delta
ro.y = wrapf( ro.y , 0.0 , 360.0)
coin.set_rotation_degrees(ro)
output:
0 #the spinSpeed
Coin_Wood_1:<Node3D#27497858247>
and an Image:
befor f6

after f6
