Game Development Community

The Complete Guide to Torque X

by Derrick Lau · in Game Design and Creative Issues · 06/25/2010 (2:07 pm) · 2 replies

I'm following the instructions of "The Complete Guide to Torque X", and am trying to add a 3D weapon to my scene object. I typed up the code as stated in the book, but don't know when to call the CreateProjectileTemplate() method. Does anybody know where I should put that call?

I ask because every time I fire the weapon, I am given the error that my Projectile template is null value.

#1
06/28/2010 (12:46 pm)
Ahh...resolved the issue myself. I didn't understand the code at first but realized over the weekend that the projectile template must be implemented and _projectileTemplate must be assigned the implementation for the code to function. Did that and everything is fine now.
#2
06/30/2010 (2:46 pm)
I've noticed that the objects I create programmatically (after giving them gravity and mass via a T3DRigidComponent) keep falling through the terrain. Is there a way I can stop this?