Not geting the name of the texture when called function GetPositionInformation
Closed this issue ยท 4 comments
This is the code i'm using to try getting the position info
var surface_data: Object = car.terrain.GetPositionInformation(global_position.x, global_position.z) for data in surface_data.get_property_list(): if data.name == 'Textures': print(data)
this is the return i'm having: { "name": "Textures", "class_name": &"", "type": 28, "hint": 23, "hint_string": "24/0:", "usage": 4102 }
it's showing only "Textures" and not the name i added to the texture.
Hey @lucasthomaz97 !
They way you should use it is like this :
var result = %TerraBrush.GetPositionInformation(playerX, playerZ)
if result != null:
var currentTexture = result.Textures[0].Name if result.Textures.size() > 0 else ""
Let me know if it works for you ! ๐
Yes, it worked, thanks.
Maybe you should write a docs for this functions to get it clearer.
If you already got it, i haven't found.
thanks for the suggestion @lucasthomaz97 I'll try to do that this week ๐!
@lucasthomaz97 FYI, I've added snippets in the readme ๐
https://github.com/spimort/TerraBrush?tab=readme-ov-file#gdscript-snippet