Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Mrpaolosarino |
If I have a bullet, I want to get the tile name if it collides with any tile , anyone??
var tilename1 = $map/TileMap.tileset.tilegetname($map/TileMap.get_cell(myposontilemap.x, myposontilemap.y))
if (npc.tilestandingon == “water” or npc.tilestandingon == “waterdeep” or npc.tilestandingon == “deepwater”) and npc.doing != “swimming” and npc.doing != “standingInWater” and npc.doing != “drowning” and npc.doing != “coma” and npc.doing != “dead”:
npc.doing = “standingInWater”
My NPC’s run around the map and constantly look for what Tile they are standing on.
This seems to be the lines of code that do this for me.
I’ll see if I can pull all my related code - I get the Tile name all the time.
Sorry if this is messy - want to try to pull some code for you quickly…
var tilename0 = $map/TileMap.tileset.tilegetname($map/TileMap.get_cell(myposontilemap.x, myposontilemap.y))
if (npc.tilestandingon == “water” or npc.tilestandingon == “waterdeep” or npc.tilestandingon == “deepwater”) and npc.doing != “swimming” and npc.doing != “standingInWater” and npc.doing != “drowning” and npc.doing != “coma” and npc.doing != “dead”:
npc.doing = “standingInWater”
My NPC’s run around the map and constantly look for what Tile they are standing on.
This seems to be the lines of code that do this for me. (Sorry, wrote over a year ago so not completely familiar with right now). check out this: https://godotengine.org/qa/user/kaylamarquez
kaylamarquez | 2023-02-08 21:37
I’ll see if I can pull all my related code - I get the Tile name all the time.
Sorry if this is messy - want to try to pull some code for you quickly…
var tilename0 = $map/TileMap.tileset.tilegetname($map/TileMap.get_cell(myposontilemap.x, myposontilemap.y))
if (npc.tilestandingon == “water” or npc.tilestandingon == “waterdeep” or npc.tilestandingon == “deepwater”) and npc.doing != “swimming” and npc.doing != “standingInWater” and npc.doing != “drowning” and npc.doing != “coma” and npc.doing != “dead”:
npc.doing = “standingInWater”
My NPC’s run around the map and constantly look for what Tile they are standing on.
This seems to be the lines of code that do this for me. (Sorry, wrote over a year ago so not completely familiar with right now).
https://godotengine.org/qa/user/joyceconley
joyceconley | 2023-02-09 00:05
'll see if I can pull all my related code - I get the Tile name all the time.
Sorry if this is messy - want to try to pull some code for you quickly…
var tilename0 = $map/TileMap.tileset.tilegetname($map/TileMap.get_cell(myposontilemap.x, myposontilemap.y))
if (npc.tilestandingon == “water” or npc.tilestandingon == “waterdeep” or npc.tilestandingon == “deepwater”) and npc.doing != “swimming” and npc.doing != "stan like https://godotengine.org/qa/user/DiannHays
DiannHays | 2023-02-09 01:40