Topic was automatically imported from the old Question2Answer platform.
Asked By
Daniel Mircea
Old Version
Published before Godot 3 was released.
I’m trying to create a laser beam like behavior that’s wide. instersect_ray seems to be limited to using single points, so it doesn’t look like a viable option.
I was thinking of creating a shape that ends just outside the screen, get hit areas with intersect_shape, sort them by distance and use the closest one.
For a wide ray you can use 2 or as many as you need between the sides.
If it is like a laser that starts growing you can have many rays and start turning them on while the laser gets wider (is for a game, it does not need to be 100% accurate, just fake stuff).
This method can give you the option to do more damage when more rays touch something and cut the ray polygon adding effects on the impact zones.