playMaker

Author Topic: Make an Object fall after a certain amount of objects are on top of it.  (Read 1738 times)

blake3d

  • Playmaker Newbie
  • *
  • Posts: 8
Hello, I am trying to task a platform to fall after a certain amount of items land on top of it. I tried a trigger event, and while I got the platform to fall after 1 entered and added a rigid body to the object, I was wondering if there was a way to tell the trigger event to wait for about maybe 10 or so to fall into it before triggering.

blake3d

  • Playmaker Newbie
  • *
  • Posts: 8
Actually, never mind, just figured out my own question.  I ended up creating a trigger state go to another trigger state 10 times before having it finally add a rigid body.  Though I am open to any other ways to approach this.

Tedthebug

  • Playmaker Newbie
  • *
  • Posts: 21
could you try holding it in place with a fixed hinge that breaks when a certain mass is reached?  If so it would be reusable with any number of items as long as the mass of each item was changed.

Or set a bool on each item that touches the object & add an int counter. Any object stacked (on collision enter adds, on collision exit subtracts just so it doesn't collapse when only 1 item is on it if the previous x-items hit it then fell off) on top of another that was already in contact would check the status of the object it landed on & if it was positive then it would add to the int count. Again that would make the # required be changeable at the time the platform etc was instantiated so you could have different requirements.


I'm open to other suggestions as well. As I'm trying to build a library of simple scripts etc that can be used at short notice for jams etc. thanks all

blake3d

  • Playmaker Newbie
  • *
  • Posts: 8
I like the bool idea, for the most part mine works when objects fall in it adds and when they fall out it subtracts, I seem to have a problem with when one of these objects explodes and destroys an object, it still thinks the item is still in there so it doesn't know to take it away, at least that's what I'm visually seeing.  might try one of your methods here, see what happens, thanks!