playMaker

Author Topic: Spawn asteroids and move  (Read 436 times)

hydrazkiller

  • Playmaker Newbie
  • *
  • Posts: 2
Spawn asteroids and move
« on: December 10, 2022, 09:37:37 PM »
Hello everyone, I am new here. I have an issue understanding how to spawn asteroids and let them move toward a goal area and then disappear.

I have followed this video https://hutonggames.com/playmakerforum/index.php?topic=9041.0

but in my case i want the spawned objects to move up to a certain point and disappear. How can i accomplish this? i cant seem to get my head around doing an FSM for an object that has not spawned yet

drown

  • Junior Playmaker
  • **
  • Posts: 58
Re: Spawn asteroids and move
« Reply #1 on: December 11, 2022, 07:36:44 PM »
You should take a look at "prefabs". These are "preset" gameobjects that can be created during runtime.

If you create a prefab with an FSM on it you have a very powerful feature : You can simply reference the gameobject itself in actions. You can do that with "Get Owner" or "Use Owner". This way you can simply apply actions to "itself" without having to drag and drop things from hierarchy in editor mode.

Another thing you can consider is tags and layers. This way you can apply a certain Tag to a prefab. THen you can use playmaker to find those gameobjects and do things with them.

I suggest you keep following along all the amazing Playmaker tutorials that are out there to get a better understanding about Unity, Playmaker, Prefabs etc. - it is fun!