Game Development Community

Blaster Tutorial Cloning Problem

by Sam M · in Torque X 2D · 04/01/2007 (2:13 pm) · 3 replies

Hi, first off all it's great to have a new build of Torque X, it looks really great so far. However I was trying the Blaster Tutorial and I ran into a problem when trying to clone the projectiles. On any line that makes a reference to projectileObj (in the FireProjectileComponent) like:


projectileObj.Position = SceneObject.Position;


I get the exception:


NullReferenceException was unhandled.

Object reference not set to an instance of an object.


So I figure there must be something wrong with the line that creates the projectile:


T2DSceneObject projectileObj = TorqueObjectDatabase.Instance.CloneObject("ProjectileTemplate");


Can anybody help me out with this? Thanks.

#1
04/01/2007 (3:30 pm)
Okay, found out the problem. I didn't give the projectile the proper name. I got confused cause there wasn't an error when it didn't find the right object, oh well. Let that be a lesson to all the TGBX'ers out there.
#2
04/24/2007 (10:10 am)
Could you point me to where this Blaster Tutorial resides?
#3
04/24/2007 (10:26 am)
@Brian - The default location (assuming you have the latest TX build) is C:\Program Files\GarageGames\Torque X\v1.0.4.2\Docs\default.htm (The tutorial can be found in the left hand menu)

You can also access it from the Start menu (start...all programs...Torque X...Torque X User's Guide)