Game Development Community

Vehicle eye and camera not working right, straight from the sdk

by Rick Kelley · in Torque Game Engine · 03/11/2006 (1:45 pm) · 3 replies

I have been pulling out my hair for a couple of days trying to figure out why when I export my vehicle, it will not use the Eye or the Cam nodes for when you mount it. I even replaced it with the stock Buggy exported from the max file with no changes. I basicaly used the car.cs file and changed nothing, renamed it snowmobile.cs and loaded it into the stock fps folder of the downloaded sdk. I used the mounting based off the badguys scripting to get it to work from this link:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2036


No matter how I tore it apart and linked the cam or the eye, it would never move from what appears as the center of the bounds box shape.

#1
03/11/2006 (2:33 pm)
Are you using a .cfg file to make sure those nodes export? Check the .dmp file to see if they are.
#2
03/11/2006 (2:58 pm)
Rick: Are you controlling the vehicle like
%player.setControlObject(%vehicle);
or
%player.client.setControlObject(%vehicle);

If you're using the first method(pretty sure stock TGE does it that way), then it will use the player's eye/cam nodes not the vehicle's, as it's the actual client's control object. Use the second way to have it render from the vehicle's nodes.

Edit: You'll want to look in player.cs, Armor::onMount to check.
#3
03/11/2006 (8:18 pm)
Thanks for the replies guys, I fired it up tonight after work and found that Josh is right, it was using the player models eye instead of the vehicle. I always use a .cfg file for export btw. Just wish that I knew this before I started pulling my hair out! :D