#how to make the character stop moving when interacting?

1 messages · Page 1 of 1 (latest)

normal oak
#

extends RigidBody3D
var is_interacting = false
@onready var journal_text = $Camera_Controller/Camera_Target/Camera3D/OpenJournal as Label3D

Called when the node enters the scene tree for the first time.

func _ready() -> void:
journal_text.visible = false

Called every frame. 'delta' is the elapsed time since the previous frame.

func _process(delta: float) -> void:
if is_interacting:
return
var input := Vector3.ZERO
input.x = Input.get_axis("move_left", "move_right")
input.z = Input.get_axis("move_up" , "move_down")

apply_central_force(input * 2400.0 * delta)

$Camera_Controller.position = lerp($Camera_Controller.position , position , 0.05)

func _on_book_body_entered(body: Node3D) -> void:
journal_text.visible=true
if Input.is_action_just_pressed("interact_key1"):
is_interacting = true

func _on_book_body_exited(body: Node3D) -> void:
journal_text.visible=false

i use Rigidbody for the character

steady steeple
#

can you send a video of what it looks like in action?