Feature 1: Display Mouse Position

Purpose

Display the real-time mouse position (X, Y) in the lower-left corner of the screen.

Input

Mouse Location: The real-time position of the mouse cursor on the screen.

Process

Capture the mouse position using Input.mousePosition.

Convert the mouse position to screen coordinates.

Assign the X and Y position values to a UI Text element.

Output

The mouse position is displayed as text in the lower-left corner of the screen.

Feature 2: Spawn Capsules at Mouse Click

Purpose

Spawn a capsule object wherever the user clicks on the screen.

Input

Mouse Left Click: Triggers capsule spawning.

Process

Detect a mouse click using Input.GetMouseButtonDown(0).

Convert the mouse position to world space using Camera.ScreenToWorldPoint or raycasting.

Instantiate a CapsulePrefab at the calculated position.

Output

A capsule object appears at the position where the mouse was clicked.

Feature 3: Visibility Toggle for Capsules

Purpose

Control the visibility of all capsule objects using a UI toggle.

Input

Visibility Toggle: UI toggle to show or hide capsules.

Process

Add a listener to the toggle event.

Find all capsules using GameObject.FindGameObjectsWithTag("Capsule").

Set their visibility using SetActive(isOn).

Output

When the toggle is ON: Capsules appear.

When the toggle is OFF: Capsules disappear.

Feature 4: Toggle Capsule Size

Purpose

Enable a toggle to make all newly spawned capsules appear larger.

Input

Size Toggle: UI toggle to change the size of capsules.

Process

Add a size condition in the spawning script.

If the toggle is ON, set the capsule scale to a larger size.

Output

When the toggle is ON: Capsules spawn at a larger size.

When the toggle is OFF: Capsules spawn at normal size.

Published 1 day ago
StatusReleased
PlatformsHTML5
AuthorYashiR
Made withUnity