Adding tab phone
This commit is contained in:
@@ -31,6 +31,9 @@ var audio_player = AudioStreamPlayer.new()
|
||||
|
||||
@export var camera_path: NodePath
|
||||
@onready var cam: Camera3D = get_node(camera_path) if camera_path != NodePath("") else null
|
||||
@export var phone_path: NodePath
|
||||
@onready var phone: CanvasLayer = get_node(phone_path) if phone_path != NodePath("") else null
|
||||
var phone_visible := false
|
||||
|
||||
func _ready() -> void:
|
||||
axis_lock_angular_x = true
|
||||
@@ -69,6 +72,11 @@ func _integrate_forces(state):
|
||||
|
||||
# Input as 2D vector
|
||||
var input2v := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
|
||||
|
||||
if Input.is_action_just_pressed("player_phone"):
|
||||
phone_visible = !phone_visible
|
||||
if phone:
|
||||
phone.visible = phone_visible
|
||||
|
||||
# Camera based movement
|
||||
var forward := Vector3.FORWARD * -1.0
|
||||
|
||||
Reference in New Issue
Block a user