]> Untitled Git - baabarian.git/blob - class/Pinball.gd
b8368681d3f4ece0c5078e67f02607fef352b8c3
[baabarian.git] / class / Pinball.gd
1 extends RigidBody3D
2 class_name Pinball
3
4
5 @onready var _mesh: Node3D = %mesh
6
7 const _moving_scale := 0.7 * Vector3.ONE
8
9
10 # Called when the node enters the scene tree for the first time.
11 func _ready() -> void:
12         pass # Replace with function body.
13
14
15 # Called every frame. 'delta' is the elapsed time since the previous frame.
16 func _process(_delta: float) -> void:
17         if angular_velocity.length() > 0.2:
18                 _mesh.scale = _moving_scale
19         else:
20                 rotation = Vector3.ZERO
21                 _mesh.scale = Vector3.ONE