playMaker

Author Topic: Help with multiple spawning points and movable spawner.  (Read 462 times)

MagnusB

  • Playmaker Newbie
  • *
  • Posts: 1
Help with multiple spawning points and movable spawner.
« on: October 18, 2021, 05:40:14 AM »
Hello everyone,

I am hoping you can help me,

I am trying to recreate a spawning system similar to the one found in the “Stacked”, but with my own spin on it.

The problems are as follow.

Problem 1 - Multiple Spawning points:
In Stacked, and in my game, I would like a game object to spawn from all 4 sides. I have figured out how to spawn 1 object at a spawning point and get that object to move towards the middle. That was relatively easy as it only required one vector3 value

So far so good. But how would I go about creating a spawning system that spawns once from each +- Z-axis and once from +- X-axis?

I have tried to illustrate it with a picture:
https://ibb.co/kq9D049

I could maybe create four different spawners and call on them randomly, but that seems like a jailbreak and not the most efficient way to do?

Problem 2 - Movable spawning points:
The second problem I ran into, which I can’t for the life of me figure out is how to get my spawner to move with my cubes. In the game Stacked and all tutorials I have seen on the game using traditional C# scripting they add that the spawner should reference “current game Object” in relation to where it should spawn on the Y-axis.

But how do you reference a currently spawned object and use that in relation to a vector3 spawn point?

Summary:
In summary, I am trying to create a spawner that can spawn from 4 different directions, lets say -4,+4 on the Z axis and -4,+4 on the X-axis. If the player manages to tap the screen within the designated area, then the spawned game object stops and a new random game object is spawned on top of the last one, and so forth.

It is relatively similar to the mechanics used in Stacked and I found some good tutorials using traditional scripting, but I am having a very hard time figuring out how to break it down in Unity.

Any help would be much appreciated.