extends MeshInstance3D
@export var rotation_speed_y: float = 0.03
@export var rotation_speed_z: float = 0.02 # Velocidad para el eje Z (ajusta según necesites)
@export var direction_change_interval: float = 3.0
var rotation_direction_y: int = 1
var rotation_direction_z: int = 1
var time_since_direction_change: float = 0.0
func _ready() -> void:
pass
func _process(delta: float) -> void:
rotate_y(rotation_speed_y * rotation_direction_y)
rotate_z(rotation_speed_z * rotation_direction_z)
time_since_direction_change += delta
if time_since_direction_change >= direction_change_interval:
rotation_direction_y *= -1
rotation_direction_z *= -1
time_since_direction_change = 0.0
No hay comentarios:
Publicar un comentario