summaryrefslogtreecommitdiff
path: root/Scenes/Mesh.gd
blob: d58d74c3eaa758490ca805df0fd18226fd3477f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
extends MeshInstance

var target_basis : Basis

func _ready():
	target_basis = transform.basis

func _process(delta):
	transform.basis = transform.basis.slerp(target_basis, delta*8)

func roll(dir : Vector2):
	target_basis = target_basis.rotated(Vector3(dir.y,0,-dir.x), deg2rad(90))