Hello , how are you doing ?
it's took me some time but i managed to making grid from grid.res in 3d , using code in gdscript .
the informations i use from this video , and from GDQuest .
things looking okay , but i didn't figure out how i make the grid in the center .
i tried some method , it didn't work out .
{
extends Spatial
export var Size: = Vector3(8,0,8)
export var Cell_Size: = Vector3(2,0,2)
var halfcellsize: = CellSize / 2
onready var Plane_: = preload("res://TRPG/Plane.res")
func calculatemapposition(gridposition: Vector3) -> Vector3:
return gridposition * CellSize + _halfcell_size
func creategrid():
for x in range(Size.x):
for z in range(Size.z):
var PlaneTile = Plane.instance()
var gridposition = calculatemapposition(Vector3(x,0,z))
PlaneTile.setname(str(x) + "," + str(z))
addchild(PlaneTile)
PlaneTile.settranslation(gridposition)
yield(gettree(),"idle_frame")
func ready():
creategrid()
}
any advice ? so the grid become in the center .
thank you