|
@ -8,6 +8,7 @@ extends CharacterBody3D |
|
|
@export var gravity: float = 9.8 |
|
|
@export var gravity: float = 9.8 |
|
|
@export var mouse_sensitivity: Vector2 = Vector2(0.1, 0.3) ## Horizontal and vertical mouse sensitivity |
|
|
@export var mouse_sensitivity: Vector2 = Vector2(0.1, 0.3) ## Horizontal and vertical mouse sensitivity |
|
|
@export var standing_height: float = 1.8 ## This should be where the head/camera would be located |
|
|
@export var standing_height: float = 1.8 ## This should be where the head/camera would be located |
|
|
|
|
|
@export var throw_velocity: float = 10.0 |
|
|
|
|
|
|
|
|
@export_group("Movement") |
|
|
@export_group("Movement") |
|
|
@export var acceleration: float = 10.0 |
|
|
@export var acceleration: float = 10.0 |
|
@ -34,7 +35,7 @@ func _input(event: InputEvent) -> void: |
|
|
if event is InputEventMouseMotion: |
|
|
if event is InputEventMouseMotion: |
|
|
_handle_mouse_movement(event.relative) |
|
|
_handle_mouse_movement(event.relative) |
|
|
elif event.is_action_pressed("throw_item"): # TODO: Move to state? |
|
|
elif event.is_action_pressed("throw_item"): # TODO: Move to state? |
|
|
EntityManager.drop_block.emit(InventoryManager.quick_slot_item_id, head.global_position, -head.global_basis.z, 10.0) |
|
|
|
|
|
|
|
|
EntityManager.drop_block.emit(InventoryManager.quick_slot_item_id, head.global_position, -head.global_basis.z, throw_velocity) |
|
|
|
|
|
|
|
|
func _physics_process(delta: float) -> void: |
|
|
func _physics_process(delta: float) -> void: |
|
|
is_crouching = Input.is_action_pressed("crouch") or ray_cast_crouch.is_colliding() |
|
|
is_crouching = Input.is_action_pressed("crouch") or ray_cast_crouch.is_colliding() |
|
|