Game Development Community

Thumbstick input empty when using T3DCameraComponent in chapter 12 of Complete Guide to TorqueX

by Todd W · in Torque X 3D · 04/09/2010 (2:09 pm) · 1 replies

I'm working through the Complete Guide to TorqueX.

After switching the <CameraComponent type="GarageGames.Torque.T3D.FreeCameraComponent" name="CameraComponent"/> to <CameraComponent type="GarageGames.Torque.T3D.T3DCameraComponent" name="CameraComponent"/> in the levelData.txtscene file the thumbstick input nolonger moves the boombot, however keyboard inout still works. If I break on the "move" object in _UpdateInput of MovementComponent3D and check the sticks property they are both constantly set to 0,0. I have version 3.1.4.0 and have am using the default MovementComponent3D class that is generated with the Simple 3D Pro template.

I have the exact same problem when I run the MyXnaFPS project in Chapter 12 that I downloaded from envygames without changing a thing, so it's obviously not my code.

Any ideas?

#1
04/29/2010 (2:51 am)
Actually if you have a look to the _SetupInput method you'll see that the gamepad is not mapped :)

You have to add the using clause on top of the file:

using GarageGames.Torque.Platform;

and add these lines in the _SetupInput:

inputMap.BindMove(gamepad, (int)XGamePadDevice.GamePadObjects.LeftThumbX, MoveMapTypes.StickAnalogHorizontal, 0);
inputMap.BindMove(gamepad, (int)XGamePadDevice.GamePadObjects.LeftThumbY, MoveMapTypes.StickAnalogVertical, 0);
inputMap.BindMove(gamepad, (int)XGamePadDevice.GamePadObjects.RightThumbX, MoveMapTypes.StickAnalogHorizontal, 1);
inputMap.BindMove(gamepad, (int)XGamePadDevice.GamePadObjects.RightThumbY, MoveMapTypes.StickAnalogVertical, 1);

Cheers,
Pino