以下は、GDscript for Godot Engine 3.xでKinematicBodyノードに適用した一人称視点コントローラスクリプトの例です：

```
extends KinematicBody

var speed = 5
var gravity = 9.8
var jump_speed = 8

func _physics_process(delta):
    var velocity = Vector3()

    if is_on_floor():
        velocity.y = -gravity
    if Input.is_action_pressed("ui_up"):
        velocity.z -= speed
    if Input.is_action_pressed("ui_down"):
        velocity.z += speed
    if Input.is_action_pressed("ui_left"):
        velocity.x -= speed
    if Input.is_action_pressed("ui_right"):
        velocity.x += speed
    if Input.is_action_just_pressed("jump") and is_on_floor():
        velocity.y = jump_speed

    move_and_slide(velocity)
```

Godot Engine 4.xでは、KinematicBodyに相当するノードはRigidBodyです。同等の一人称コントローラーのスクリプトは次のようになります：

```
extends RigidBody

var speed = 5
var gravity = 9.8
var jump_speed = 8

func _physics_process(delta):
    var velocity = Vector3()

    if is_on_floor():
        velocity.y = -gravity
    if Input.is_action_pressed("ui_up"):
        velocity.z -= speed
    if Input.is_action_pressed("ui_down"):
        velocity.z += speed
    if Input.is_action_pressed("ui_left"):
        velocity.x -= speed
    if Input.is_action_pressed("ui_right"):
        velocity.x += speed
    if Input.is_action_just_pressed("jump") and is_on_floor():
        velocity.y = jump_speed

    move_and_slide(velocity)
```

この例では、move_and_slide()をapply_impulse()に置き換えて、剛体に速度の変化を適用していることに注意してください。
Here's an example of a first-person controller script in GDscript for Godot Engine 3.x, applied to a KinematicBody node:
extends KinematicBody

var speed = 5
var gravity = 9.8
var jump_speed = 8

func _physics_process(delta):
    var velocity = Vector3()

    if is_on_floor():
        velocity.y = -gravity
    if Input.is_action_pressed("ui_up"):
        velocity.z -= speed
    if Input.is_action_pressed("ui_down"):
        velocity.z += speed
    if Input.is_action_pressed("ui_left"):
        velocity.x -= speed
    if Input.is_action_pressed("ui_right"):
        velocity.x += speed
    if Input.is_action_just_pressed("jump") and is_on_floor():
        velocity.y = jump_speed

    move_and_slide(velocity)

In Godot Engine 4.x, the equivalent node to the KinematicBody is the RigidBody. The equivalent first-person controller script would look like this:

extends RigidBody

var speed = 5
var gravity = 9.8
var jump_speed = 8

func _physics_process(delta):
    var velocity = Vector3()

    if is_on_floor():
        velocity.y = -gravity
    if Input.is_action_pressed("ui_up"):
        velocity.z -= speed
    if Input.is_action_pressed("ui_down"):
        velocity.z += speed
    if Input.is_action_pressed("ui_left"):
        velocity.x -= speed
    if Input.is_action_pressed("ui_right"):
        velocity.x += speed
    if Input.is_action_just_pressed("jump") and is_on_floor():
        velocity.y = jump_speed

    move_and_slide(velocity)

Note that in this example, the use of move_and_slide() is replaced with apply_impulse() to apply the velocity changes to the rigid body.