Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Your mesh
- var cubeMash = load("res://cubes/testcube.msh")
- #probably needs to be a global var, cant add to tree
- var cubeMultimash = MultiMesh.new()
- cubeMultimash.set_mesh(cubeMash)
- #First vector is the standard position of new MeshInstances
- #Second vector is the size of new MeshInstances
- cubeMultimash.set_aabb(AABB(Vector3(0,0,0),Vector3(2,2,2)))
- #Couldnt get #cubeMultimash.generate_aabb() to work
- var cubeMeshInstance = MultiMeshInstance.new()
- cubeMesh.set_multimesh(cubeMultimash)
- cubeMultimash.set_instance_count(1)
- #set new position
- cubeMesh.translate(Vector3(0,2,0))
- #add new mesh to tree so it doesnt get cleaned up
- add_child(cubeMesh)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement