Game Development Community

Airplane tutorial Help. "create and register a camera for the compass"

by Sam Pay · in Torque X 2D · 10/16/2009 (9:40 am) · 1 replies

Right ive been working through the airplane tutorial and its seemed to be going really well untill i got too creating the camera that mounts to the compass (about half way through section 6). Ive read through the code and i understand what and why is going on but for some reason its throwing me this error:

// create and register a camera for the compass
T2DSceneCamera DefaultCamera = TorqueObjectDatabase.Instance.FindObject("Camera");

It is throwing back an error on TorqueObjectDatabase.Instance.FindObject("Camera");

cannot implicitly convert type 'GarageGames.TorqueBase' to 'GarageGames.Torque.T2D.T2DSceneCamera' An Explicit Coversion Exists (are you missing a cast?)

When i debug without this code in the compass works fine but the camera obviously doesnt mount so i just fly off into the distance.

Any Help at all would be greatly appreciated. I am rather impressed with the engine so far and i am thinking about creating my project using it. But there seems to be a rather lot of inconstancies with the tutorials which is a little worrying.

thanks alot

sam

About the author

doing a MSc in Software Enterprise and setting up my own Small games company. Currently working on a release for XBL Indie games and PC.


#1
10/17/2009 (4:56 pm)
Try
T2DSceneCamera DefaultCamera = TorqueObjectDatabase.Instance.FindObject<T2DSceneCamera>("Camera");