Author Topic: How do I make only one object not be destroyed when pressing R?  (Read 1652 times)

l3agu32

  • Wannabe
  • Posts: 22
  • OS:
  • Windows 8.1/Server 2012 Windows 8.1/Server 2012
  • Browser:
  • Chrome 49.0.2623.87 Chrome 49.0.2623.87
    • View Profile
  • Playstyle: Keyboard
I made an object only for visual purpose and want it not to be destroyed when pressing R. I tried making the room persistent, but it affected other objects, what slowed down the rhythm of the level design.

Kyir

  • The Kid
  • Posts: 293
  • Normal Guy
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 49.0.2623.87 Chrome 49.0.2623.87
    • View Profile
  • Playstyle: Keyboard
Re: How do I make only one object not be destroyed when pressing R?
« Reply #1 on: March 19, 2016, 04:47:44 PM »
You could make the object itself persistent I guess? Just be sure to check if one exists before making more so you don't overload everything.

l3agu32

  • Wannabe
  • Posts: 22
  • OS:
  • Windows 8.1/Server 2012 Windows 8.1/Server 2012
  • Browser:
  • Chrome 49.0.2623.87 Chrome 49.0.2623.87
    • View Profile
  • Playstyle: Keyboard
Re: How do I make only one object not be destroyed when pressing R?
« Reply #2 on: March 19, 2016, 06:38:13 PM »
You could make the object itself persistent I guess? Just be sure to check if one exists before making more so you don't overload everything.
The object is actually already persistent.

patrickgh3

  • Spike Dodger
  • Posts: 169
  • stay optimistic! :D
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Chrome 49.0.2623.87 Chrome 49.0.2623.87
    • View Profile
    • Github
  • Playstyle: Keyboard
Re: How do I make only one object not be destroyed when pressing R?
« Reply #3 on: March 19, 2016, 08:48:53 PM »
I think the best approach is to make the object or objects persistent.

As for it not working when you tried it, here's an approach I like using. Start a new empty project, and then import the visual effect objects from your main project (right click on "Objects" -> add existing object). You could also instead just create simplified versions of the objects. Then make an object that switches or restarts the room when you press a key. Now you can fiddle around and make the effect persist properly, without anything getting in your way. Once you've got it working, you can go back to your main project and make it work there. And if you have trouble during this step, you know that it's something external in your project that's affecting it, so that helps to isolate the problem. I hope this approach helps.