Spawning Garbage Randomly

So I have this game, where its about Waste Segregation,
There’s a Hallway like a Maze type-hallway.
Player needs to pick up the trash 1 by 1 to their designated waste bins.
How should I approach Spawning trash?

You have a couple of options…

  • Calculate a path to the waste bin, you can possibly do this using A* pathfinding, then
    traverse the path and put trash along the path on a random chance so that not every node has trash, but every few nodes.

  • If you want an easier way but more messy, you could put waypoint empty gameobjects along the path and in code get all of them in a list, and pick some random waypoints and spawn trash on their position.