4 wheel car problem!!
by Diego Castaneda · in Torque 3D Professional · 10/22/2009 (3:12 pm) · 15 replies
Hi everybody, I followed many tutorials and read another forums about creating vehicles, but im still having the same problem when i load my car in torque. I built a 4 wheel car in Maya and export fine, but in torque 3D my car load only with the 2 front wheels, the back 2 wheels doesnt appear(is like it doesn't exist or haven't created), i have trying many things but the problem continuous, i dont know what could it be? help please....
About the author
#2
http://www.garagegames.com/community/resources/view/9863
10/22/2009 (10:55 pm)
Hi Mike, im using the default car.cs that comes in the datablocks, im just trying to change the model using Autodesk Maya to create a new one and using the same nodes that i find in this tutorial: http://www.garagegames.com/community/resources/view/9863
#3
10/23/2009 (12:33 am)
Do you have hub0,hub1,hub2 and hub3 defined? If you do then make sure the hub3,hub4 are linked the same way as hub0,hub1 are linked.
#4
10/23/2009 (12:23 pm)
Randy when i load the original buggy model, it show up with the 4 wheels and the same with a ferrari model that i find in another forum show up with the 4 wheels, i dont know why my car show up only with 2 front wheels... :(
#5
10/23/2009 (12:48 pm)
post your vehicles script file
#6
My guess is that he only has hub0,hub1 connected correctly in Maya and hub2,hub3 are either not there or not connected. If he is getting 4 wheels on the other vehicles, then it has to be his model.
can you post a pic of your model hierarchy in Maya? Or the tree from the Shape Editor in T3D
10/23/2009 (12:56 pm)
I am not sure it is his script file. Sounds like he is using the default script?My guess is that he only has hub0,hub1 connected correctly in Maya and hub2,hub3 are either not there or not connected. If he is getting 4 wheels on the other vehicles, then it has to be his model.
can you post a pic of your model hierarchy in Maya? Or the tree from the Shape Editor in T3D
#7
If you followed that link and renamed the hubs per Step 7.
rename hib1,hib2 to hub1,hub2 there is a typo in that resource.
10/23/2009 (1:00 pm)
Ahhh here is the problem...If you followed that link and renamed the hubs per Step 7.
Quote:
Now rename "mount1" up to "mount4" to hub0, hib1, hib2 and hub3.
rename hib1,hib2 to hub1,hub2 there is a typo in that resource.
#9

http://i742.photobucket.com/albums/xx70/gibkraft/outlinermaya.jpg

http://i742.photobucket.com/albums/xx70/gibkraft/shapeeditor.jpg
10/23/2009 (4:08 pm)
Randy i check that mistake too, but my nodes are named well...
http://i742.photobucket.com/albums/xx70/gibkraft/outlinermaya.jpg

http://i742.photobucket.com/albums/xx70/gibkraft/shapeeditor.jpg
#10
10/23/2009 (4:11 pm)
/-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
function WheeledVehicleData::create(%block)
{
%obj = new WheeledVehicle(carrito) {
canSaveDynamicFields = "1";
position = "7.58008 104.664 105.2049";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "DefaultCar";
disableMove = "0";
mountable = "1";
};
return(%obj);
}
function WheeledVehicleData::onAdd(%this,%obj)
{
%obj.mountable = true;
//creo el turret
$turret = TurretData::create(GenericTurret);
MissionGroup.add($turret);
// Setup the car with some defaults tires & springs
for (%i = %obj.getWheelCount() - 1; %i >= 0; %i--) {
%obj.setWheelTire(%i,DefaultCarTire);
%obj.setWheelSpring(%i,DefaultCarSpring);
%obj.setWheelPowered(%i,false);
}
// Steer front tires
%obj.setWheelSteering(0,1);
%obj.setWheelSteering(1,1);
// Only power the two rear wheels...
%obj.setWheelPowered(2,true);
%obj.setWheelPowered(3,true);
%obj.mountObject($turret,0);
}
function WheeledVehicleData::onCollision(%this,%obj,%col,%vec,%speed)
{
// Collision with other objects, including items
}
// Used to kick the players out of the car that your crosshair is over
function serverCmdcarUnmountObj(%client, %obj)
{
%obj.unmount();
%obj.setControlObject(%obj);
%ejectpos = %obj.getPosition();
%ejectpos = VectorAdd(%ejectpos, "0 0 5");
%obj.setTransform(%ejectpos);
%ejectvel = %obj.mVehicle.getVelocity();
%ejectvel = VectorAdd(%ejectvel, "0 0 10");
%ejectvel = VectorScale(%ejectvel, %obj.getDataBlock().mass);
%obj.applyImpulse(%ejectpos, %ejectvel);
}
// Used to flip the car over if it manages to get stuck upside down
function serverCmdflipCar(%client)
{
%car = %client.getControlObject();
if (%car.getClassName() $= "WheeledVehicle")
{
%carPos = %car.getPosition();
%carPos = VectorAdd(%carPos, "0 0 3");
%car.setTransform(%carPos SPC "0 0 1 0");
}
}
function serverCmdsetPlayerControl(%client)
{
%client.setControlObject(%client.player);
#11
Maybe Shaul will see something in the code...
10/23/2009 (6:04 pm)
I figured you had, but always good to check:) I have done stuff like that before..Maybe Shaul will see something in the code...
#12
%obj.setWheelTire(%i,DefaultCarTire);
and put this:
%obj.setWheelTire(0,DefaultCarTire);
%obj.setWheelTire(1,DefaultCarTire);
%obj.setWheelTire(2,DefaultCarTire);
%obj.setWheelTire(3,DefaultCarTire);
just above this line:
// Steer front tires
tell me if that works.
10/24/2009 (5:05 am)
comment out this:%obj.setWheelTire(%i,DefaultCarTire);
and put this:
%obj.setWheelTire(0,DefaultCarTire);
%obj.setWheelTire(1,DefaultCarTire);
%obj.setWheelTire(2,DefaultCarTire);
%obj.setWheelTire(3,DefaultCarTire);
just above this line:
// Steer front tires
tell me if that works.
#13
Randy Thanks for your help anyway :)..
10/24/2009 (12:20 pm)
Hi deepscratch, I try but it doesnt work, still the same problem :(Randy Thanks for your help anyway :)..
#14
10/25/2009 (12:46 am)
I had a similar problem a while back. It turned out to be some of the hubs had their origin rotated. Not knowing how Maya is setup, you might try deleting and re-creating the hubs for the ones wheels not appearing.
#15
10/27/2009 (3:33 pm)
thanks for the help randy i'm gonna try re doing it, maybe the ten time is the charm :p. Thanks for the help.

Torque Owner Mike Rowley
Mike Rowley
I haven't had any problems getting all 4 wheels to mount. (they just don't mount where I want them too. (my fault))