0 votes

I want to implement a wavy laser beam similar to the Proton Backpack in Enter the Gungeon.

https://youtu.be/wl-o6gbMqFM?t=58

It's easy enough to draw a line from one point to another, but how to get the undulating curviness and the lighting effects?

How could one achieve a similar effect in Godot?

asked Aug 27, 2018 in Engine by Diet Estus (1,494 points)

I will add this as a comment rather than an answer since I don't know wether it would work or not.

What I would try is to calculate an array of points from beginning to end, and smooth a variation range with something like gaussian noise (that would get you soft curved paths), then just keep adding the next gaussian coordinate and deleting the first ones so it can flow.

I can't add more since I don't even know how to use the gaussian algorithm, but I saw something like this for Processing (although Processing actually have a next_gaussian() method that does the trick effortlessly).

You can make a series of lines which lead to a target, and then, using a Curve2D, smooth it out. The trouble with this method is you have to smooth out the curve at runtime. So you need to set the control points in the Curve2D such that they change with the position of the player, and the player's intended target.

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.