Feat/12 add effects and better animations to fpv #17
@@ -674,7 +674,17 @@ func server_receive_inputs(input_dir: Vector2, wish_dir: Vector3, jump: bool, ju
|
|||||||
func _physics_process(_delta: float) -> void:
|
func _physics_process(_delta: float) -> void:
|
||||||
# Local client captures input and sends it
|
# Local client captures input and sends it
|
||||||
if is_multiplayer_authority():
|
if is_multiplayer_authority():
|
||||||
var raw_input := Input.get_vector("move_left", "move_right", "move_forward", "move_back")
|
var raw_input := Vector2.ZERO
|
||||||
|
var input_jump := false
|
||||||
|
var input_jump_just := false
|
||||||
|
var input_crouch := false
|
||||||
|
var input_dash := false
|
||||||
|
var input_grapple := false
|
||||||
|
var input_grapple_just := false
|
||||||
|
var world_dir := Vector3.ZERO
|
||||||
|
|
||||||
|
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
|
||||||
|
raw_input = Input.get_vector("move_left", "move_right", "move_forward", "move_back")
|
||||||
var forward := -global_transform.basis.z
|
var forward := -global_transform.basis.z
|
||||||
forward.y = 0.0
|
forward.y = 0.0
|
||||||
forward = forward.normalized()
|
forward = forward.normalized()
|
||||||
@@ -682,16 +692,16 @@ func _physics_process(_delta: float) -> void:
|
|||||||
right.y = 0.0
|
right.y = 0.0
|
||||||
right = right.normalized()
|
right = right.normalized()
|
||||||
|
|
||||||
var world_dir := (forward * (-raw_input.y) + right * raw_input.x)
|
world_dir = (forward * (-raw_input.y) + right * raw_input.x)
|
||||||
if world_dir.length_squared() > 1.0:
|
if world_dir.length_squared() > 1.0:
|
||||||
world_dir = world_dir.normalized()
|
world_dir = world_dir.normalized()
|
||||||
|
|
||||||
var input_jump = Input.is_action_pressed("jump")
|
input_jump = Input.is_action_pressed("jump")
|
||||||
var input_jump_just = Input.is_action_just_pressed("jump")
|
input_jump_just = Input.is_action_just_pressed("jump")
|
||||||
var input_crouch = Input.is_action_pressed("crouch")
|
input_crouch = Input.is_action_pressed("crouch")
|
||||||
var input_dash = Input.is_action_just_pressed("dash")
|
input_dash = Input.is_action_just_pressed("dash")
|
||||||
var input_grapple = Input.is_action_pressed("grapple")
|
input_grapple = Input.is_action_pressed("grapple")
|
||||||
var input_grapple_just = Input.is_action_just_pressed("grapple")
|
input_grapple_just = Input.is_action_just_pressed("grapple")
|
||||||
|
|
||||||
if Input.is_action_just_pressed("toggle_flashlight") and is_instance_valid(flashlight):
|
if Input.is_action_just_pressed("toggle_flashlight") and is_instance_valid(flashlight):
|
||||||
flashlight.visible = !flashlight.visible
|
flashlight.visible = !flashlight.visible
|
||||||
|
|||||||
Reference in New Issue
Block a user