Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Geometry.CreateSphere() should get its own class? #11

Description

@valkyrienyanko

I was thinking of doing something like

var sphere = Sphere.Create(); // or could be cube
sphere.SetColor(Colors.Blue).SetSize(0.5f).DeleteLater(2);

public static void CreateSphere(Vector3 pos, float radius = 0.2f, float removeDelay = -1)
{
var sphere = new MeshInstance3D();
sphere.Mesh = new SphereMesh();
var sphereMesh = (SphereMesh)sphere.Mesh;
sphereMesh.Radius = radius;
sphereMesh.Height = sphereMesh.Radius * 2;
sphere.Position = pos;
if (removeDelay != -1)
{
var timer = SceneTree.CreateTimer(removeDelay);
timer.Timeout += () => sphere.QueueFree();
}
SceneTree.Root.AddChild(sphere);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededquestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions