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"):

        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 (21 points)

1 Answer

+1 vote
Best answer

Multiply your angle by delta.

by (1,127 points)
selected by

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

Use lerp() or lerp_angle() then. Check the docs for more info on that.

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 [email protected] with your username.