Skip to content

Every cube spawns at the world origin #4

Description

@dmccoystephenson

Problem

In src/CubeFactory.cs, every spawned cube is placed at the world origin:

// set position
newCube.transform.position = new Vector3(0, 0, 0);

Because the position is a hard-coded constant, N spawned cubes occupy the same point in space and are visually indistinguishable from a single cube. The Debug.Log(cubes.Count) on the next line is the only indication that anything happened.

Suggested resolution

Options worth the owner's consideration, in increasing order of scope:

  • Spawn at the factory GameObject's own position (transform.position) rather than the origin
  • Offset each cube by its index so a spawned stack or row is visible
  • Expose a serialized spawn-position or spawn-offset field so the placement is configurable

Verification note

This is a behavioural change to src/CubeFactory.cs and requires a play-mode run in the Unity Editor to verify. Which of the above is wanted is a design decision for the repository owner, so no option has been implemented.

This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions