extends RigidBody3D @export var speed: float = 20.0 @export var shot_speed: float = 30.0 var target_velocity = Vector3.ZERO var init_pos = Vector3.ZERO func _ready(): init_pos = global_position func _process(delta): if Input.is_action_just_pressed("ui_home"): global_position = init_pos if Input.is_action_just_pressed("ui_accept"): apply_central_impulse(Vector3(0, shot_speed, -shot_speed)) var d = Vector3.ZERO if Input.is_action_pressed("ui_left"): d.x = -1 if Input.is_action_pressed("ui_right"): d.x = 1 if Input.is_action_pressed("ui_up"): d.z = -1 if Input.is_action_pressed("ui_down"): d.z = 1 if d != Vector3.ZERO: d = d.normalized() d.x *= speed d.z *= speed apply_central_force(d) #func _integrate_forces(state): #pass