Skip to content

Probable missing line of code in example code, ArrayMesh documentation #9675

Open
@AlphaLuceatLaetis

Description

@AlphaLuceatLaetis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:manualIssues and PRs related to the Manual/Tutorials section of the documentationdiscussionenhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions