godotengine / godotengine/godot-docs

Probable missing line of code in example code, ArrayMesh documentation

Open
#9,675 5 comments 0 reactions 0 assignees View on GitHub
area:manual discussion enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**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:
```
# Create mesh surface from mesh array.
# No blendshapes, lods, or compression used.
mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, surface_array)
```
"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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.