I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: l3agu32 on March 19, 2016, 04:18:27 PM

Title: How do I make only one object not be destroyed when pressing R?
Post by: l3agu32 on March 19, 2016, 04:18:27 PM
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.
Title: Re: How do I make only one object not be destroyed when pressing R?
Post by: Kyir 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.
Title: Re: How do I make only one object not be destroyed when pressing R?
Post by: l3agu32 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.
Title: Re: How do I make only one object not be destroyed when pressing R?
Post by: patrickgh3 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.