I know this question is probably very redundant, but please hear me out.
So I’m working on space adventure game with heavy combat elements with intentions of expanding it with role playing elements as I go. I’m a graphic designer with strong knowledge on programming with Javascript from my time spent in web design and I have been learning the ropes of Unity. Introductions said and done, here is my question:
I’m trying to understand some of the pros and cons, along with the finer details of methods used for lasers, bullets, and so on.
-
The first method I see most commonly
is using a particle system with
raycast. I have yet to spend a lot
of time using raycast, but from what
I understand, it detects a collision
with an object and if the fire
button is pressed, it applies damage
to the object colliding with the
raycast. My main problem with this
is that the damage is instant and
you can’t dodge the projectiles, not
to mention running into the
particles themselves does nothing. -
The second method is to use a
particle system with a particle
collider, but with this you can’t
detect where the particle is
colliding for generating impact
effects (they impact in the center
of the object they’re colliding
with, not the point of collision).
I also noticed that the reference
manual says that particle collision
uses a lot of overhead, but the
particle system only uses one draw
call(?). -
The one I see second most commonly is an object with a trail renderer. My question is what kind of object do you tie it to? An invisible mesh? An empty game object? Does it have a rigid body? My main problems I’ve seen with this is draw calls and objects skipping past collisions. On the plus side however, speeds could be easily adjusted and effects (sparks, explosions) would be easy upon destruction and lights could be added.
-
The last one I’ve seen is a line renderer which seems to use similar methods to method #3.
So finally, here is what I am looking for specifically:
- Lasers/bullets that have a tracer and are clearly visible.
- Adjustable speeds and can be dodged (if slow enough).
- Have an impact effect of some kind on point of impact (sparks, explosion, etc).
- Can be given some kind of small, randomized angle to make them slightly imperfect (if I choose).
- A lot of these projectiles will be on screen (huge capitol ship battles, turrets, etc)
- A PLUS: If it’s not too heavy on overhead, emits light.
Any help will be GREATLY appreciated. I’m building it for computer, so I’m not trying to cram this onto an iPhone, though I’d still like to try and keep it optimized.