0
\$\begingroup\$

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?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

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

%tileMap = $LastLoadedScene.getGlobalTileMap();  
%layerCount = %tilemap.getTileLayerCount();  
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .