0 votes

how to create aiming line (or maybe can with dot) like billiard game or some brickbreaker game?

in Engine by (48 points)

Have a Raycast aim from a certain point (taking from your billiard example, a pool cue) and draw a dotted line along the length of the Raycast. When the player has chosen the desired target, use the Vector2 of the Raycast in the movement code. Use a "dotted" texture with a Line2D to draw the actual line pointing to the target.

oo ive got the answer i try to create line using set position and it works, so i can aim using mouse position,

and the end point of my aiming line is on the mouse position, how to make it trough to the viewport border? and is it possible to create reflect line if the line is goes to oustide of the viewport?

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.