0 votes

Hello, I am new to Godot3D and trying to follow the tutorial here:

https://www.youtube.com/watch?v=yRHN_WEulLc&list=WL&index=1&ab_channel=Tutemic

extends KinematicBody

export var _mouse_sensitivity: float = 0.20

func _ready() -> void:
    Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)


func _input(event) -> void:
    aim(event)

func _physics_process(delta):
    var movement_vector: Vector3

    if Input.is_action_pressed("move_forward"):
        movement_vector = Vector3(0, 0, 1)

    move_and_slide(movement_vector)

func aim(event: InputEvent) -> void:
    var mouse_motion = event as InputEventMouseMotion
    if mouse_motion:
        self.rotation_degrees.y -= mouse_motion.relative.x*_mouse_sensitivity

        var current_tilt: float = $Camera.rotation_degrees.x
        current_tilt -= mouse_motion.relative.y*_mouse_sensitivity

        $Camera.rotation_degrees.x = clamp(current_tilt, -180, 0)

This issue doesn't occur if I comment out the y-axis rotation or moveandslide. I've tried locking the fps and disabling vsync, but looks like something else is the issue. Any help would be appreciated!

Godot version 3.2
in Engine by (16 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.