SetControlObject Problem
by Kristian Dupont · in Torque Game Engine · 01/02/2005 (6:42 am) · 9 replies
Hi all
I have a question regarding the setControlObject function.
I have two objects a Vehicle and a Player. I start by creating my player object and give control to the client over the player object.
As an exsample i what to take control of the Vehicle. I use the setControlObject function and i get control. I can control the Vehicle now. But the camera (view) doesn't follow.
My problem is that the camera stays with the player object. I found out that the view is a control object and not a camera.
How do i get the (camera) to change to my new control object?
I want to get the effect that i'm looking out through the vehicle.
I have a question regarding the setControlObject function.
I have two objects a Vehicle and a Player. I start by creating my player object and give control to the client over the player object.
As an exsample i what to take control of the Vehicle. I use the setControlObject function and i get control. I can control the Vehicle now. But the camera (view) doesn't follow.
My problem is that the camera stays with the player object. I found out that the view is a control object and not a camera.
How do i get the (camera) to change to my new control object?
I want to get the effect that i'm looking out through the vehicle.
About the author
#2
// Find an empty seat
%seat = findEmptySeat(%vehicle, %vehicledata);
%obj.mVehicle = %vehicle; //Engine vars. S
01/02/2005 (7:20 am)
Yes i mount like this // Find an empty seat
%seat = findEmptySeat(%vehicle, %vehicledata);
%obj.mVehicle = %vehicle; //Engine vars. S
#3
Maybe thats what your looking for?
-Jase
01/02/2005 (7:44 am)
I have this in my OnMount: %obj.client.setObjectActiveImage(%vehicle, 1);
Maybe thats what your looking for?
-Jase
#4
I've been wondering about this function and it's purpose. I can see it reffered to in the FPS exsample, but i can't find a declaration. In scirpt or in the engine code. Do you have the function some where or is it obsolete ?
01/02/2005 (8:28 am)
Thanks JaseI've been wondering about this function and it's purpose. I can see it reffered to in the FPS exsample, but i can't find a declaration. In scirpt or in the engine code. Do you have the function some where or is it obsolete ?
#5
-Jase
01/02/2005 (9:20 am)
I see now that it probably is obsolete since it says it can't be found in the console.-Jase
#6
If so, I have a fix for you. But it requires a modification to the engine's code and I am only allowed to post it in the SDK Forum.
I'll make another thread in the SDK Forum with the fix to use Vehicle cam nodes instead of the player object's cam nodes when mounted. Look for it there.
-Jase
01/05/2005 (6:06 am)
Okay, I re-read your post and I think I may have misunderstood what your problem was. I think you have the same problem that I had a little while back. Basicly when mounted you want the camera to the use vehicle's eye transform instead of the player objects?If so, I have a fix for you. But it requires a modification to the engine's code and I am only allowed to post it in the SDK Forum.
I'll make another thread in the SDK Forum with the fix to use Vehicle cam nodes instead of the player object's cam nodes when mounted. Look for it there.
-Jase
#7
02/06/2006 (5:59 am)
I can't find your fix. Can you give a link ?
#8
-Jase
02/25/2006 (8:40 pm)
@Danny: Sure thing. http://www.garagegames.com/mg/forums/result.thread.php?qt=24620-Jase
#9
07/31/2006 (10:37 pm)
I am having this same problem but the aformentioned fix does not work.
Torque Owner Brett Fattori
- Brett