var mesh = ArrayMesh.new()
var data = 
data[ArrayMesh.ARRAY_VERTEX] = vertices
data[ArrayMesh.ARRAY_TEX_UV] = UVs
data[ArrayMesh.ARRAY_INDEX] = indices
data[ArrayMesh.ARRAY_NORMAL] = normals
This line returns a shape for use in collisions, but you aren't using the return value. So it runs for nothing.
You should grab the result of create_trimesh_shape and assign it to a CollisionShape node in your scene.
thanks for the fast answer.
i'm new to coding and godot :(, can you tell me how to assign it to a Collisionshape node?
and here's my func that use:
if block_map == null:
mesh_node = get_node_or_null(block_map)
if mesh_node == null:
mesh_node.mesh = _generate_mesh()
is_initialized = true
i try to code: meshmode.createtrimesh_shape(), but it gives an error.
Do you know how to setup collision shapes in the first place? I suggest you take a look at how they work: https://docs.godotengine.org/en/stable/tutorials/physics/physics_introduction.html
The shape you obtain from the generated mesh is a resource.
Your node should have (or be) a StaticBody node, with a CollisionShape node as child. CollisionShape has a property named shape, and that's the one you need to assign the return value of create_trimesh_shape().
are you the man who create the voxel plugin?
omg, i think you are!