+1 vote

RailGun made as hitscan weapon. So, it makes raycast, and then need to draw a shot. I can add Line2D but how to make it beautiful. I want that player can feel that it is very fast bullet, not just line (as laser for i.e.) I need some visual effects for it

So, how can I draw beatiful line that will look like a shot of RailGun.

in Engine by (246 points)

1 Answer

+1 vote

I need some visual effects for it

enter image description here

enter image description here
https://www.youtube.com/watch?v=dg0CQ6NPDn8

That's exactly what particle systems are for, visual effects. Place it on the tip of the gun or the start of the raycast, and use it's target location as a direction to rotate the particles using the function look_at().

As a warning, don't edit directly by code the Particle processing material, because it's a shared resource, similarly to shaders, changing one will change every instanced copy of that particle.

https://docs.godotengine.org/en/stable/tutorials/2d/particle_systems_2d.html

For your laser texture to be pretty, you can simply use a nine patch rect, which is a control type that can basically stretch textures using a repetition pattern.

by (333 points)
edited by

but will that work for 3D? He's making an fps.

I assumed 2D because he mentioned Line2D, but with 3D things aren't so different, in fact you have more options because you're in 3D.

  • use sprite textures as muzzleflash which is a old technique, if combined with shaders it looks reasonable good.
  • Simulate 3D particles to make gunshot effects, can be done with sprite texture particles for example.
  • Create a 3D mesh of the muzzeflash of the gun and apply volumetric materials or simple bloom-like shaders.
  • Play videofootage of vfx (video special effects) assets as a sprite texture, but require extra work to make it look good in 3D.

There are many techniques one can use to make beautiful vfx effects, I would recommend to watch how other games do it. Simple pause a gameplay video on youtube for example, and you can study the effects by moving frame by frame, the effects look complex during gameplay but actually are really simple.

do you know any good tutorials on godot 3d particles? I can't figure them out.

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.