Stuck with branches and Spawing objects

I want to fix the out of bound spawning, the “screen to world” node doesn’t work very precisely, I’m not sure how to fix this but for now I just want the objects to not spawn outside the view. The script works except that since I have 2 “branch” nodes and have 4 “spawn object” nodes, 2 objects are always spawned. I have no idea how to connect them to only one “spawn object” node. I tried connecting them into one “spawn object” node but that will only take one connection.

here is the .blend file:
Mouse Spawn test.blend (588.7 KB)


After talking on discord and getting some pointers I was able to fix the issue. Here is the blend:Mouse Spawn test - fixed.blend (567.4 KB)

1 Like