Game Development Community

Mounting lights on projectiles?

by Paul Jan · in Torque Game Engine · 05/24/2006 (8:16 pm) · 6 replies

I've been trying to mount lights on bullets to get a tracer effect, but mountrotation doesn't seem to work (yes i've been using the light datablock). Is this something inherant in the projectile class?

#1
05/26/2006 (4:04 am)
Hi Paul,

Are you mounting a light to each projectile that's created, or just setting the projectile's 'hasLight' property to true?
#2
05/26/2006 (4:28 am)
Mounting a light.
#3
05/26/2006 (11:18 am)
Make sure the values you put into the rotation are small. The coord system is the same as object rotation (accessible through the mission editor), and follows the format:

'<x rotation amount> <y rotation amount> <z rotation amount> <angle>'

For instance to rotate the light 90 degrees on the x I would use '1 0 0 90'. For an example of how this works check out the object rotation property in the mission editor.

Let me know if this helps!
#4
05/28/2006 (4:52 am)
Ah - didn't figure out what units the rotation was in.

I'm trying to make the line-like bullets that are in most games now using the corona on lights, but I didn't notice they were billboards.
#5
05/30/2006 (5:39 am)
Try mounting volume lights instead, that should give you a nice streak behind the projectile.
#6
05/31/2006 (10:34 pm)
I think the problem I'm having is that the projectile doesn't face acording to the vector its travelling. So if I have a light mounted, its going to be facing one direction no matter if i'm shooting up, down or straight - which looks downright wierd.