Open AlphaLuceatLaetis opened 1 month ago
You've missed that this script is attached to a MeshInstance3D
, the mesh
is a property
You missed this part:
In the editor, create a MeshInstance3D and add an ArrayMesh to it in the Inspector.
Please make sure you've read the tutorial properly
I've read that part, of course. Anyway, it's odd that in Godot 4.2 MeshInstance3D.mesh.add_surface_from_arrays(...) doesn't exist, returning error. While you find that function under ArrayMesh. Hence, that is why I opened the issue. Did I miss anything, perhaps?
You didn't follow that instruction:
add an ArrayMesh to it in the Inspector.
You added some other type probably
I see, then it's all correct. My bad, it seemed that something was missing, a common issue when mixing editor and code together, thing get "hidden". I'm glad it's not an error, sorry for wasting your time.
No worries! There could be some details to improve, like mentioning that mesh
is a member property
Godot version: Godot 4.2.2, Documentation referred to stable(4.2)
Issue description: Following the ArrayMesh tutorial and explanation, in the first "full" code example, the last line explains how to create the mesh with all the data we settled up:
"mesh" isn't declared anywhere in the code example, making it hard for a new user to identify where to find the function and what "mesh" actually is. I'd suggest adding the declaration for "mesh", making it straightforward what it is. I guess the solution should be to add "var mesh=ArrayMesh.new()", making the example code clearer.
URL to the documentation page: https://docs.godotengine.org/en/stable/tutorials/3d/procedural_geometry/arraymesh.html