Recieving Error #1009

YuriG

  • Posts: 8
Also, collectables that just fade out look bad, so don't do that.

Thanks. It is not necessary. But because I'm new, it is good to ask and try anything. So far I removed it, because I could not solve it. Thanks Innes and Photon
If you just want something clean and easy, just kill it right away while the data is still remembered.

I did. And looks better

irock

  • *
  • Posts: 2879
Yes Irock. When I connect this behavior in collectibles, works fine. But if I connect a behavior to the main character eg "when actor hit collectible" crashes.
Yes. That's probably because you were referencing something that had a value 0.9 seconds ago but doesn't anymore, or if it still has a value, like if you were still colliding with the collectible, it's trying to kill it multiple times because for every "frame" you're touching the collectible, it starts a timed task 0.9 seconds of length that kills the actor, so even if it does successfully kill the actor, it's going to try many more times to kill an actor that's already dead.

You could have the behavior attached to your player, have an actor attribute called "collectible", set the attribute to said actor, and 0.9 seconds later, kill the actor stored in the attribute. However, it wouldn't work if you touch another collectible during the 0.9 seconds it takes to kill it because the attribute will be overwritten with the collectible you just touched.

So yeah, attaching it to the collectible is the way to go.