GDScriptでファーストパーソンコントローラースクリプトを作成し、Godot Engine 3.xを使用する場合、Kinematicbody-Nodeに適用するにはどうすればよいですか。Godot Engine 4.xで動作するために変更する必要がありますか？
Godot Engine 3.xでは、新しいスクリプトを作成してKinematicBodyノードにアタッチすることで、GDscriptで一人称コントローラのスクリプトを書くことができます。以下は、基本的な一人称コントローラのスクリプトの例です：
```csharp
extends KinematicBody

var speed = 5
var mouse_sensitivity = 0.1
var jumping = false
var jump_speed = 10
var gravity = -20
var jump_height = 1.5
var jump_sustain = 0.1

func _input(event):
    if event is InputEventMouseMotion:
        rotation_degrees.y -= event.relative.x * mouse_sensitivity
        rotation_degrees.x = clamp(rotation_degrees.x + event.relative.y * mouse_sensitivity, -90, 90)
    
    if event is InputEventKey and event.pressed and event.scancode == KEY_W:
        var velocity = speed * Vector3(0, 0, 1)
        velocity = velocity.rotated(Vector3(0, 1, 0), -rotation.y)
        move_and_slide(velocity)
        
    if event is InputEventKey and event.pressed and event.scancode == KEY_S:
        var velocity = speed * Vector3(0, 0, -1)
        velocity = velocity.rotated(Vector3(0, 1, 0), -rotation.y)
        move_and_slide(velocity)
        
    if event is InputEventKey and event.pressed and event.scancode == KEY_A:
        var velocity = speed * Vector3(-1, 0, 0)
        velocity = velocity.rotated(Vector3(0, 1, 0), -rotation.y)
        move_and_slide(velocity)
        
    if event is InputEventKey and event.pressed and event.scancode == KEY_D:
        var velocity = speed * Vector3(1, 0, 0)
        velocity = velocity.rotated(Vector3(0, 1, 0), -rotation.y)
        move_and_slide(velocity)
        
    if event is InputEventKey and event.pressed and event.scancode == KEY_SPACE and not jumping:
        jumping = true
        var velocity = Vector3(0, jump_speed, 0)
        move_and_slide(velocity)
        
func _physics_process(delta):
    if jumping:
        var velocity = move_and_slide(Vector3(0, gravity * delta, 0))
        if velocity.y < 0:
            jumping = false
```

Godot Engine 4.x では、KinematicBody ノードに相当するのは CharacterController ノードです。このノードを使用するには、スクリプトをCharacterControllerクラスを継承するように変更する必要があります。さらに、CharacterControllerノードは異なるAPIを使用するため、入力処理と移動制御が異なります。以下は、Godot Engine 4.xでの一人称コントローラのスクリプトの例です：
```
extends CharacterController

var speed = 5
var mouse_sensitivity = 0.1
var jumping = false
var jump_speed = 10
var gravity = -20
var jump_height = 1.5
var jump_sustain = 0.1

func _input(event):
    if event is InputEventMouseMotion:
        rotation_degrees.y -= event.relative.x * mouse_sensitivity
        rotation_degrees.x = clamp(rotation_degrees.x + event.relative.y * mouse_sensitivity, -90, 90)

    if event is InputEventKey and event.pressed and event.scancode == KEY_W:
        var velocity = speed * Vector3(0, 0, 1)
        velocity = velocity.rotated(Vector3(0, 1, 0), -rotation.y)
        move(velocity)
    
    if event is InputEventKey and event.pressed and event.scancode == KEY_S:
        var velocity = speed * Vector3(0, 0, -1)
        velocity = velocity.rotated(Vector3(0, 1, 0), -rotation.y)
        move(velocity)
    
    if event is InputEventKey and event.pressed and event.scancode == KEY_A:
        var velocity = speed * Vector3(-1, 0, 0)
        velocity = velocity.rotated(Vector3(0, 1, 0), -rotation.y)
        move(velocity)
    
    if event is InputEventKey and event.pressed and event.scancode == KEY_D:
        var velocity = speed * Vector3(1, 0, 0)
        velocity = velocity.rotated(Vector3(0, 1, 0), -rotation.y)
        move(velocity)
    
    if event is InputEventKey and event.pressed and event.scancode == KEY_SPACE and not jumping:
        jumping = true
        var velocity = Vector3(0, jump_speed, 0)
        velocity = velocity.rotated(Vector3(0, 1, 0), -rotation.y)
        move(velocity)
    
func _physics_process(delta):
    if jumping:
        var velocity = move(Vector3(0, gravity * delta, 0))
    if velocity.y < 0:
        jumping = false
```

Note: `move` メソッドは Godot Engine 3.x の `move_and_slide` メソッドを置き換えたもので、CharacterController API を使用して移動を処理します。