Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I start a blank project I have noticed that I get one t2dSceneGraph and one t2dTileMap (under the project tab). I selected the t2dTileMap and gave it a name 'tilemap'.

In my game.cs function startGame I added

%LayerCount = tilemap.getTileLayerCount();  

...but when I execute the project and inspect the variable %LayerCount in Torsion I first of all get an error:

Unable to find object: 'tilemap' attempting to call function 'getTileLayerCount'

How do I access the default t2dTileMap?

share|improve this question
up vote 0 down vote accepted

Never mind here is the answer if somone else would like to know...

%tileMap = $LastLoadedScene.getGlobalTileMap();  
%layerCount = %tilemap.getTileLayerCount();  
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.