How to pick objects in TGB?
by Russell Buxton · in Technical Issues · 01/01/2008 (10:07 pm) · 4 replies
Hello.I'm trying to pick objects with a left click of mouse and simply echo what object or objects have been clicked.I tried the mini tutorial on mouse selections but its giving me errors.It's the "pickPoint thats doing it.The error in the console says"Unable to find object: 't2dScene' attempting to call function 'pickPoint'.I don't have my folder structured like in the tutorial.I created a new project called "Working_Project" in my "Torque\Games" folder so I could use it to practice with.Is that a bad idea?Could it be the problem?Also,in the tutorial the "pickPoint" is used inside of an "sceneWindow2D" function but in the TGB reference it is used as a callback on a "sceneGraph".Don't know if thats important or not.Anyway, i've tried several different things with no success.Any help would be appreciated.Thanx.
#2
You should try the Torque Game Builder forums. If you click the Community Menu, then Forums, and then edit your subscriptions at the top, you should be able to add the public forums.
01/02/2008 (6:46 am)
You should be able to do it in the demo version.You should try the Torque Game Builder forums. If you click the Community Menu, then Forums, and then edit your subscriptions at the top, you should be able to add the public forums.
#3
The scene window is what levels are loaded into, the scene graph is the level itself. You start with the scene window, ask for the scene graph loaded into it, then get the list of objects at a particular point.
Hope it helps.
01/02/2008 (10:34 am)
TrySceneWindow2D.GetSceneGraph().GetPickPoint(0, 0)
The scene window is what levels are loaded into, the scene graph is the level itself. You start with the scene window, ask for the scene graph loaded into it, then get the list of objects at a particular point.
Hope it helps.
#4
01/02/2008 (12:05 pm)
Thanx David...I didn't know about the other forums.I really should post my questions there instead.Thanx also Nick...I'll give that a try right now...
Torque Owner Russell Buxton