Godot 4.3
I want to make trimesh collision from MeshInstance3D in the script , but i dont know how to do that. Can someone tell me how to do that
Godot 4.3
I want to make trimesh collision from MeshInstance3D in the script , but i dont know how to do that. Can someone tell me how to do that
Try this:
func generate_trimesh_collision(mesh_instance: MeshInstance3D)
var collision = CollisionShape3D.new()
collision.shape = mesh_instance.mesh.create_trimesh_shape()
var static_body = StaticBody3D.new()
static_body.add_child(collision)
mesh_instance.add_child(static_body)