playMaker

Author Topic: Create Object & Loop State - Only giving properties to first created object  (Read 1245 times)

LoopyPaladin

  • Playmaker Newbie
  • *
  • Posts: 2
Hey there,

I'm pretty new to Playmaker, so I understand that there's probably a better way to achieve what I need. This is just what made sense to me initially, but I'm having issues.

I want to be able to create more dice when points are spent (-5 points button adds one to the dice owned count) which are stored in a variable and looped based on that number, and those dice should be rolled and all have the same properties (gravity, velocity, spawn position) when the corresponding "roll" button is pressed. When the roll button is pressed again, it should delete all dice from the board before spawning the next set.

The problem is, only the first object instantiated has any of these properties. Furthermore, when I go to reset the board, it only removes the first object and the rest are left on the board.

Am I doing this entirely wrong? How do I spawn multiple instances of the same prefab object at once and have them all gain the same properties?

LeDisciple

  • Playmaker Newbie
  • *
  • Posts: 41
Hi,

As Alex Chouls said to you on another of your post, Empty Parent Object is a good way if it's simple to "hold" the child, you injected variables on each children you spawned with a different name and you you kill the Empty parent when necessary. You can use a pool too ( an array of objects, I really love that way because the script create the child, give him a name and kill him one shot!! ; hahahaha) and empty it when pushing your button and refill the next round, sky is the limit with playmaker!! :D
« Last Edit: April 02, 2026, 12:56:10 AM by LeDisciple »