The topic says it all, currently in our game we’re shooting bullets that are set up like this.
Normal Fire
Transform
Cube (Mesh Filter)
Box Collider
-Is Trigger
Mesh Renderer (off)
Rigid Body
-Gravity Off
Ellipsoid Particle Emitter
-Max Min Emission: 1
-Ellipsoid 0,0,0
Particle Animator
Particle Renderer
-Stretched
-Velocity Scale: 0.1
NormalFire.cs
This prefab is created and fired at the target at whatever speed we set.
I think this stems from my lack of knowledge about how the particle systems work. I’m able to get all sorts of effects that I want when just working with the particle systems, but when they’re moving or affected by outside forces I’m a bit lost.
The kind of gunfire being aimed for is tracer style fire, so the line renderer really isn’t appropriate, and from what I understand it’s slightly more expensive, and this game is for the iPhone, so keep that in mind.
So what’s the problem? No matter what I seem to do, the particles don’t seem to act as if they’re just being given 50 units of velocity or force going the direction they are. The results I get firing are totally different than what I get just adding 50 units of local force to the emitter or animator.
When I fire, if its at 40 or 50, I dont see a thing, if its at 10, I see a single spot where they animate for a moment about 3 quarters of the way to their target. Does anyone have a good idea for using particle animators like this?
I’ve considered other options like just having a particle emitter and passing the correct values to it based on the vector difference of the player and the enemy, then giving it velocity, and having it turn on and off, or having multiple created with one shot and autodestruct on, but this seems like it wouldn’t be the best way. Meanwhile the invisible cubes would still have to be thrown, and the feedback wouldn’t always match up with the animations hitting when the cubes do.
EDIT: I was thinking more about this, and I think what’s happening is caused by this.
The particles themselves stretch based on their velocity relative to the emitter, but we’re moving the emitter. Is this how they work?
If so, is there any way to just create a particle and have it render without an emitter? Almost like a permenant particle that will allow stretching based on its own non relative velocity? Any ideas are welcome, or even something pointing to a tutorial or somewhere in the right direction. Nothing about this I could find in the help component files, but perhaps I missed them.