Game Development Community

Vehicle Lights

by Britt Scott · in Torque Game Engine · 09/05/2008 (6:05 pm) · 1 replies

I'm confused on what needs to be done to be able to have headlights. I tried looking at the swinging light in the TLK demo, but I'm not sure how it works. Based on the TDN articles I found out it needs to be "attached", instead of "mounted". I'm guessing the attaching of the light needs to take place in the onAdd of the wheeledVehicle, but what lighting and attaching information do I need there? Also, does the light get attached to a mount node or a light node? Thanks in advance!

About the author

Attended Brown College in Mendota Heights, MN for Game Design and Development. Projects include the Mech Starter Kit and the Battle Frog. Currently working toward a game design career.


#1
09/05/2008 (11:38 pm)
After some hours of exploring, I got it to work. I took the sgMountLight that is commented out in the player.cs and placed it in the onAdd of my vehicle cs. In order to attach the object, I had to go to: C:\TGE_1_5_2\common\lighting\lights\sgMountLight.cs and change the mountpoint to the mount node on my vehicle. I also changed the rotation. I'm sure now I can adjust the settings to get a desired head light. I've only been able to get this to work in the starter.fps May just need some more testing :) Hopefully I can also make mounting a light easier too!