Game Development Community

Just got 1.5 and have a question about behaviors

by JD Scogin · in Torque Game Builder · 07/19/2007 (12:00 pm) · 3 replies

This is a very basic question. I want to use the Shoots behavior. It has a drop down for projectile. In the drop down is "None". The question is (don't laugh, I am just starting with this) how do I get a projectile in the drop down list.
Thank much.
Jd

EDIT
Well, I guess I figured it out. Just name an object projectile.
Doah!

#1
07/19/2007 (12:14 pm)
You just need to create a template projectile. Drag whatever sprite you want to use for the projectile onto the scene and give it a name. Now it'll show up in the dropdown. ^_^

In the code, this is what creates the dropdown menu or "field"...
%template.addBehaviorField(projectile, "The projectile to clone and shoot", object, "", t2dSceneObject);

It's looking for an object, and will display all named 2D objects that you have in your scene. Hope this helps.
#2
07/19/2007 (2:10 pm)
Ah, I see. Thanks.
I had some objects in the seen but had not named them.
That makes sense.
Jd
#3
07/19/2007 (2:15 pm)
Lol you beat my post by a few minutes, glad you figured it out.