0 votes

Trying to draw bullets trail using raycast2d and draw line, so if a bullet hits target the trail ends...

rcp = raycast.get_global_transform().origin.distance_to(raycast.get_collision_point())
draw_line(raycast.position, Vector2(rcp, 0), Color.red, 1, true)

For some reason the line this draws is too short...

Let me know if I need to clarify what I mean. Sorry I am very tired its late.

in Engine by (87 points)

1 Answer

0 votes

Fixed this morning with


, instead raycast...

by (87 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 webmaster@godotengine.org with your username.