extends MeshInstance3D
@export var rotation_speed: float = 0.03
@export var direction_change_interval: float = 3.0 # Intervalo de cambio de dirección en segundos
var rotation_direction: int = 1
var time_since_direction_change: float = 0.0
func _ready() -> void:
pass
func _process(delta: float) -> void:
rotate_y(rotation_speed * rotation_direction)
time_since_direction_change += delta
if time_since_direction_change >= direction_change_interval:
rotation_direction *= -1
time_since_direction_change = 0.0
No hay comentarios:
Publicar un comentario