MountObject?
by Daniel Buckmaster · in Torque Game Engine · 02/24/2007 (4:17 am) · 8 replies
This function is documented on TDN, but when I try to use it, I get 'Unable to find function mountObject'. Has the function been dropped since that was written? If so, how can I just mount an object to an arbitrary node on a shape? (Not using slots or images.)
About the author
Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!
#2
Well, now I have no console error, but the thing isn't being mounted. It remains in place.
02/24/2007 (5:08 am)
And %mount slot has to be a string? For example %car.mountObject(%man,"DriverSeat"); (where the node's nae was DriverSeat)?Well, now I have no console error, but the thing isn't being mounted. It remains in place.
#3
so
edit: typo
02/24/2007 (5:15 am)
No, i believe its a number.so
%car.mountObject(%player, 0);will mount the player on "mount0" (node in the car model)
edit: typo
#4
Is there a way to find the position of an arbitrary node? Not necessarily a getMuzzleTransform, but something like getNodeTransform("thenodeIwant")?
02/24/2007 (12:35 pm)
Okay. So I have to name nodes that I want to mount things on mountx.Is there a way to find the position of an arbitrary node? Not necessarily a getMuzzleTransform, but something like getNodeTransform("thenodeIwant")?
#5
you dont have to use getNodeTransform in this case.
02/24/2007 (1:58 pm)
You should have a node (or more) called mount0, mount1 ect. in you model. Then simply use as i said before%car.mountObject(%player, 0);to mount the player on node "mount0" and to mount the player on "mount1" use
%car.mountObject(%player, 1);
you dont have to use getNodeTransform in this case.
#6
02/24/2007 (11:38 pm)
Aha! Works perfectly :). Thank you for the help.Quote:you dont have to use getNodeTransform in this case.I know, but I was just interested.
#7
02/25/2007 (2:26 am)
GetNodeTransform doesnt exist. There is a method called "findNodeTransform" which isnt a console method and i think has another purpose. You could however use "getEyeTransform" as a base to make getNodeTransform which will get you the world transform of a (mount) node in the model.
#8
02/25/2007 (6:23 am)
And that would involve engine code changes. All right. Well, I think I'll get back to that when I've learned a little more about C++ and Torque...
Torque 3D Owner Vincent D
I think the function should still work. hope this helps