godot-parkour/addons/qodot/game_definitions/fgd/solid_classes/rotate.gd

27 lines
623 B
GDScript3
Raw Normal View History

2024-02-22 19:56:13 +00:00
class_name QodotRotateEntity
extends CharacterBody3D
@export var properties: Dictionary :
get:
return properties # TODOConverter40 Non existent get function
set(new_properties):
if(properties != new_properties):
properties = new_properties
update_properties()
var rotate_axis := Vector3.UP
var rotate_speed := 360.0
func update_properties():
if 'axis' in properties:
rotate_axis = properties['axis']
if 'speed' in properties:
rotate_speed = properties['speed']
func _ready() -> void:
update_properties()
func _process(delta: float) -> void:
rotate(rotate_axis, deg_to_rad(rotate_speed * delta))