0 votes

I am really newbie in godot, I copy pasted some code from online. The problem is I need to rotate the ball 180 degrees and go the way the ball is facing when the ball hits the bar, I think the ball is rotating but it is not going the way it is facing. I used the Vector2.()rotated function. I think I did something wrong in the Vector2.rotated function. If anyone know what I did wrong pls answer me.
drive image

File Download

Godot version 3.4.2stable
in Engine by (22 points)

1 Answer

0 votes

I don't know the value of your rotation variable is in your code, but I'm guessing that you maybe set it to 180? If you did, that's likely the problem as it expects the argument to be provided in radians.

In that case, you can use rotated(deg2rad(180))

by (16,852 points)
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.