Skip to content

Legato12/TestAssigment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Falling Spheres (Unity Test)

Small Unity scene: spheres spawn from one fixed point, fade in while falling, bounce on a platform, roll, collide, and fade out when needed. Spawn rate is adjustable with a slider.

The goal was to keep it simple and clean, like a quick prototype.


How to run

  1. Open the project in Unity (URP recommended, tested in Unity 2022.3 / Unity 6).
  2. Open scene: Assets/Scenes/01_TestAssignment.unity
  3. Press Play.
  4. Use the slider at the bottom to change the spawn speed.
  5. Hold Left Mouse to orbit the camera.

// I have tested the project and noticed that after cloning, some links may not work correctly. It runs fine on my side, but you might need to re-assign certain materials or UI elements after cloning.

For a quick preview, you can test the project here: https://el-legato.itch.io/testsassigment

Controls

  • Left Mouse + Drag — orbit + add force to spheres. (Through then with the force)
  • Spawn Rate Slider — slower ↔ faster flow.

What happens

  • Fade‑In while falling: new spheres start transparent and become opaque.
  • Landing & nudge: first contact gives a small bounce and a push sideways.
  • Collisions: sphere vs sphere → fade‑out and remove.
  • Distance rule: if a sphere rolls too far from its landing point → fade‑out.
  • Camera nudge: quick camera moves add a tiny push to spheres that are on the platform (not the ones in the air).
  • Pooling: spheres are reused (no runtime Instantiate/Destroy spam).

Project layout (short)

  • Assets/Scripts/
    • Spawner.cs — timer + slider to spawn spheres from one fixed point.
    • SpherePool.cs — very simple object pool.
    • SphereAgent.cs — sphere logic (fade in/out, bounce, roll, collisions).
    • OrbitCamera.cs + OrbitImpulseBus.cs — orbit camera and small world push.
    • LightRigController.cs — slow light motion for nice highlights.
    • PhysicsSetup.cs — ignore certain layer collisions.
  • Assets/Scenes/01_TestAssignment.unity — main scene.
  • Assets/Settings/ — URP profiles (optional).

Tuning (Inspector)

SphereAgent

  • Bounce
    • lateralSpeedRange — horizontal speed on first bounce
    • upwardSpeedRange — vertical speed on first bounce
  • Secondary bounce (small extra hop after landing)
    • secondaryBounceCoeff (0.2–0.35 works well)
    • secondaryMinSpeed, secondaryCooldown, secondaryMaxBounces
  • Fade
    • collisionFadeSpeed, distanceFadeSpeed, distanceThreshold
  • Blue palette only
    • hueCenter ~0.61 (blue), hueSpread ±0.03, saturationRange, valueRange
  • Emission (HDR)
    • emissionWhileFalling, emissionWhenLanded (higher = stronger bloom)

Spawner

  • spawnInterval (smaller = faster flow)
  • maxActive cap to keep performance safe

Build

  1. File → Build Settings…
  2. Add Assets/Scenes/01_TestAssignment.unity.
  3. Choose PC, Mac & Linux Standalone (or any target).
  4. Build.

Notes

  • Pooling is used to keep FPS stable.
  • Material color/emission are changed with MaterialPropertyBlock (no material duplication).
  • Platform is a simple disc (or a bowl) with a collider; tag Ground.
  • Camera push affects only grounded spheres (not airborne ones).

Possible extras (if needed later)

  • Rim / Fresnel emission for a stronger “glow from inside”.
  • Auto camera path + timed flow ramp for a quick demo video.

About

Unity test: pooled falling spheres with fade, bounce, and adjustable flow.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages