Create an actor just once and not ...

airman4

  • Posts: 874
... multiple times

I created a behavior wich make create a platform at random place when you land on a platform
The problem is when the character lands, it creates multiples times

so i think it's because my character is on the platform , so it will create non-stop, until my character leaves.

So how to make the behavior create just ONE OBJECT , and not many

My behavior
When this collides etc etc
if the top was hit
create actor type at x center of self , y center of self at front
disable this behavior

but seems not work , the disable thing.

docskull

  • Posts: 65
Had the same prob with "disable this behavior" seems not to work

Nomosoft

  • Posts: 122
If you're having a problem with a behavior not shutting itself off, just use a Boolean variable and an If block to skirt the issue.

OnCreate() {
  var hasAlreadySpawned = False;
}

OnCollission() {
  if (hasAlreadySpawned == false) {
    SpawnPlatform();
    hasAlreadySpawned = true;
  }
}

So, once a platform has spawned another platform, it will set hasAlreadySpawned to true, and it will not spawn any more platforms.

Edit: Also, if Disable Behavior is not working, that should probably go in Bug Reports.