gizmo semi functional?
This commit is contained in:
parent
ff0d1a5156
commit
42d238a2f8
7 changed files with 48 additions and 15 deletions
|
|
@ -56,3 +56,7 @@ func _process(delta):
|
|||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
func _on_twitch_link_drop_block():
|
||||
turn_timer = 0
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ extends Node3D
|
|||
@export var rotation_speed : float = 20 #degrees per second
|
||||
@export var height_speed : float = 0.5 # m per second
|
||||
|
||||
@export_group("Node References")
|
||||
@export var gizmo_pivot : Node3D
|
||||
|
||||
#Onready Variables
|
||||
|
||||
#Other Variables (please try to separate and organise!)
|
||||
|
|
@ -37,6 +40,7 @@ func _process(delta):
|
|||
else:
|
||||
rotation_degrees.y -= rotation_speed * delta
|
||||
pass
|
||||
gizmo_pivot.rotation_degrees.y = rotation_degrees.y
|
||||
#endregion
|
||||
|
||||
#region Signal methods
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ extends Node3D
|
|||
@export var block_scene : PackedScene
|
||||
@export_group("Node References")
|
||||
@export var blocks_node : Node3D
|
||||
@export var gizmo_node : Node3D
|
||||
|
||||
#Onready Variables
|
||||
|
||||
|
|
@ -51,13 +52,11 @@ func _on_twitch_link_move_block(direction, amount):
|
|||
func _on_twitch_link_rotate_block(direction, amount):
|
||||
var dir : Vector3
|
||||
match direction:
|
||||
"up": dir = Vector3.UP
|
||||
"down" : dir = Vector3.DOWN
|
||||
"north" : dir = Vector3.FORWARD
|
||||
"east" : dir = Vector3.RIGHT
|
||||
"south" : dir = Vector3.BACK
|
||||
"west" : dir = Vector3.LEFT
|
||||
"x": dir = Vector3.RIGHT
|
||||
"y" : dir = Vector3.UP
|
||||
"z" : dir = Vector3.BACK
|
||||
rotation_degrees += dir * amount
|
||||
gizmo_node.rotation_degrees = rotation_degrees
|
||||
|
||||
func _on_twitch_link_drop_block():
|
||||
current_block.freeze = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue