hello everyone,
I recently saw a video that implemented lightning linking of multiple objects. Can this be achieved in Godot?
video links:
hello everyone,
I recently saw a video that implemented lightning linking of multiple objects. Can this be achieved in Godot?
video links:
Of course it can be achieved. You can probably even follow this Unity tutorial to get working in Godot, just translating the syntax to Godot-specific.
If you can’t do that, you are probably beginning your journey with Godot or game dev in general, in which case I suggest you to look into the Godot tutorials and do some simpler projects first.
Hello,
I am a beginner and have developed two games, but there are still many things I don’t understand. I have been thinking about the lightning effect for a long time but haven’t figured out how to implement it in Godot. Do you have any specific tips? For example, what node is used to create it?
If you mean the visual side of the effect, then you can probably do it with a Particle system, or custom shaders (you can even find some examples when you Google “godot vfx lightning”)
As for the linking effect - there’s no specific Node that would do exactly that, you need to write the logic yourself. It’ll for sure be a combination of at least areas and colliders.
Give it a try and let me know if you get stuck at any specific point.
Thank you very much for your help
I only watched the first 20 seconds of the linked video. but do you mean something like this?
A subject like this was recently brought up on these forums. My implementation is in 2D, but should also work in 3D with some basic editing.
The thin slow-moving bolts and the chonky bolts are effectively done with two different scripts. The former is quite a bit more involved than the latter (and I think it’s the latter you’re interested in anyway.)
The yellow guys in my video are RigidBody2D
s with two notable scenes attached:
Area2D
that checks if its collision shape overlaps yellow guys (that aren’t the yellow guy the Area2D
is a child node of.) It emits signals that inform the parent node of yellow guys entering and leaving the collision shape.Node2D
with a script that contains an array to which the parent node adds or removes targets (i.e. the yellow guys detected by the other node.) It also has a function that, when called, figures out which node in the array is its closest neighbor (if it has one), and then draws a lightning bolt between it and the neighbor. It then tells its neighbor to do the same. There’s a bit of logic to keep the neighbor from firing back at the original source.The lightning bolt is just a simple Line2D
with two points; a start and an end. The Line2D
is textured, and its material is a lightning shader I copied from the internet.