Help - How to set rotated\flipped tiles in a #godot Tilemap? And how to get rotation?

Subscribers:
64
Published on ● Video Link: https://www.youtube.com/watch?v=JfCG9uFI3Cw



Category:
Guide
Duration: 0:17
62 views
1


The Problem:
I update the tilemap when the door is opend. I do this with the code below but as shown in the video the rotation information is lost on set...

How to get rotation amount from the tile

and how to set it on a new title?


Code:
--if Input.is_action_just_pressed("use"):

----if lastEventZone != null:

------if lastEventZone.eventName == "Door":

--------var tileMap:TileMap = GlobalVariables.map

--------var door_tile:Vector2i = tileMap.local_to_map(lastEventZone.position)

--------var data:TileData = tileMap.get_cell_tile_data(0, door_tile,false)

--------var atlasCords:Vector2i = tileMap.get_cell_atlas_coords(0, door_tile,false)

----------------var update:Vector2i = GlobalVariables.\

----------tileDoorMapping[str(atlasCords.x) + "|" + str(atlasCords.y)]

----------------if update != null:

----------tileMap.set_cell(0, door_tile, 0, update, 0)

var fh:bool = data.flip_h

var fv:bool = data.flip_v

var tp:bool = data.transpose







Tags:
Godot
GodotDev
GodotEngine
Help