Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Yasin |
I am trying to create a platform game like temple run in 2D. I created the platform using tilemap . But how can I instance the tilemap as the player moves ?
I used the code
var tileMap = preload("PATH TO SCENE")
func placeTileMap(pos,rot):
var tileMapInstance = tileMap.instance()
tileMapInstance.position = pos
tileMapInstance.rotation = rot
$"TILE MAP MANAGER".add_child(tileMapInstance)
I create a spawnerground(Node2D) and attached a child node TILE MAP MANAGER(Node).Put the code in spawnerground script . But on executing i got a blank screen. Is. there any other way for instancing a tilemap scene ?