Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.