Mounting Objects In Game
by John Klotz · in Torque Game Builder · 07/31/2006 (8:16 am) · 7 replies
How do you go about mounting an object to another object with in the course of a game. I want an object to mount to another object when they collide. What code withing the collision function would be neccessary to make this happen?
Thanks for any and all help.
Thanks for any and all help.
#2
How would one go about mounting something to the mouse pointer? I want to be able to to move the mouse over something, click on it, pick it up(have it mounted to the pointer), and drop it again somewhere else.
08/01/2006 (9:35 am)
Thank you very much. I was toying with the mount command before and couldn't get it to work right.How would one go about mounting something to the mouse pointer? I want to be able to to move the mouse over something, click on it, pick it up(have it mounted to the pointer), and drop it again somewhere else.
#4
08/01/2006 (9:55 am)
Hmm, it seems like just yesterday that TDN was under construction, and now its full blown Torque mayhem!
#5
I followed the tutorial code for code. Any ideas what I am doing wrong here?
08/01/2006 (11:36 am)
Awesome, thanks. I keep receiving the error Unable to find object: 't2dscene' attempting to call function ' setdebugon' when I type in t2dScene.setDebugOn(BIT(1));I followed the tutorial code for code. Any ideas what I am doing wrong here?
#7
08/01/2006 (3:03 pm)
@John - By default the t2dSceneGraph used to be named t2dScene, but it's no longer named by default. That's why t2dScene could not be found. Apurva's suggestion will work though, as long as you dont rename your scene window.
Torque Owner Apurva Amin
if playerClass::onCollision(%srcObj, %dstObj, %srcRef, %dstRef.....){ %srcObj.mount(%dstObj, .....); }Untested, but makes sense. Check the TGB reference for the required parameters.