+1 vote



As in the first screenshot, the ball is moving in the direction I specified with raycast2d. I show the next direction from the collision point with the second raycast2d, but it acts as in screenshot 2 due to the way the ball collides. How do I get Raycast2d to show the right direction?

asked May 22 in Engine by Metehan Ă–zbek (13 points)

1 Answer

0 votes

Create a new invisible edge for the raycast2d and slide the red edge down the length of the radius of the ball. wall_y_position -= ball_radius.

You need to draw the line according to the center of the circle, not the edge.

answered 1 day ago by razah (118 points)
edited 1 day ago by razah
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.