playMaker

Author Topic: Appearing & disappearing platforms.  (Read 1873 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Appearing & disappearing platforms.
« on: August 31, 2014, 04:02:45 PM »
Basically I have a simple trigger FSM set up for one platform to create another platform beside it. The problem is I am trying to set up the trigger in order to have the new platform disappear/destroy when the player exits it.

#1. So the first state has 2 Trigger Events, one Enter the other Exit.

#2. Second state Create Object with the platform prefab and empty object to spawn, then when it flows back into the first state it enters the third state.

#3. And the third state has "Destroy Object" action that is suppose to destroy the platform prefab. The problem is I get an error in the console and the game stops running.

Code: [Select]
Destroying assets is not permitted to avoid data loss.
If you really want to remove an asset use DestroyImmediate(theObject,true);

What do I do to fix this problem.

Thanks.

Phuzz

  • Full Member
  • ***
  • Posts: 101
    • Bzilla Games
Re: Appearing & disappearing platforms.
« Reply #1 on: September 01, 2014, 01:34:28 PM »
You probably have the actual prefab in the Destroy Object section "Game Object", Create a Global Variable "GameObject" for example "Platform_Weak" and store the platform in that variable upon creation. When you destroy the object, specify game object and add the "Platform_Weak" Variable from the list, this should work.
Bzilla Games "Education with a Tickle!"
Qbucket Games "Voxel Games"

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Appearing & disappearing platforms.
« Reply #2 on: September 01, 2014, 03:33:08 PM »
It didn't work until I added the global variable to Store Object on the previous state with the Create Object action. Set up a delay, now it works the way that I want it to.

Thanks.

« Last Edit: September 01, 2014, 06:28:17 PM by coffeeANDsoda »