I'm now experimenting with vertices code to see if I can finish off the functional side of this effect that I'm working on while I think about how to neaten up the way the shader and viewport is behaving. Do I need to do something extra to grab the vertices of the mesh I'm editing for this to work? I'm getting an error.
extends MeshInstance
func _ready():
SetVerticesPositions()
func SetVerticesPositions():
var mesh = ArrayMesh.new()
var meshDataTool = MeshDataTool.new()
meshDataTool.set_vertex(0, Vector3(0, 100, 0))
E 0:00:00.579 set_vertex: Index p_idx = 0 is out of bounds (vertices.size() = 0).
<C++ Source> scene/resources/mesh_data_tool.cpp:355 @ set_vertex()
<Stack Trace> CylinderMeshVerticesPosition.gd:11 @ SetVerticesPositions()
CylinderMeshVerticesPosition.gd:4 @ _ready()
I'm just trying to get a vertices to change position at the moment, nothing too complex as of yet, I'm wanting to grab individual vertices on the mesh and edit them.