0 votes

Hello everyone,

video

I am looking for a way to slowly rotate the triangle in the video (which is a node2d with a polygon2d inside it). If I use lookat(globalmouse_position()) the the change in rotation is instantaneous. I am trying to emulate the steering behaviour following this video, it uses p5js for drawing on the screen, and the code for the tutorial is here, just not able to emulate the float theta = velocity.heading2D() + PI/2; behaviour.

Here's the code for the entire scene, code

Here's what i tried newly and gave me weird results
var dir = g_velocity.angle_to(location) rotation = lerp_angle(rotation, dir, 0.1)

in Engine by (12 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 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.