0 votes

Hi guys... i'm trying to rotate a KinematicBody on it's Y axis and for now i have this current setup:

extends KinematicBody

func _ready():
    print("Rotation: " , self.rotation.y)
    print("Rotation degrees: " , self.rotation_degrees.y)

func _process(delta):
    if Input.is_action_just_released("rotate_left"):
        rotate_y(deg2rad(int(90)))

        print("Rotation: " , self.rotation.y)
        print("Rotation degrees: " , self.rotation_degrees.y)
        print("Tasto Q premuto")

I want to make the rotation smooth. Also i noticed in the prints that my object @180 degree print a value like

Rotation: -3.141593
Rotation degrees: -179.999985

I understand the first one but not the second. Doesn't the second be 180 ?

Godot version 3.3
in Engine by (12 points)

1 Answer

0 votes

Multiply your angle by delta.

by (1,051 points)

Nothing, I just want to replicate the rotation in games like Etrian Odyssey. In short, when I press the Q key, the kinematic Body rotate itself of 90° then stops

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 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.