How to make actor spawn only once?
justinodunn
Member, PRO Posts: 226
i made it so if the user touches the screen an actor will spawn and appear for a few seconds and be destroyed when the timer is up. But when i touch the screen again, the actor will spawn again... so how can i make it spawn only once after the screen is touched once?
Comments
Rule: When attribute TOGGLE is 0 then
Spawn Actor
Change attribute TOGGLE to 1
That way, it'll only spawn the actor when TOGGLE is 0, and as soon as the actor is spawned, it'll change toggle to 1, preventing any further spawning.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Touch changes it to true.
When true spawn actor.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@justinodunn Can you please share with me how you did it? I am killing my self over here trying to make it work but nothing. I tried @Socks and @Armelline methods but it seems i am making mistake somewhere but i don't know where!
@RedCubeGames You might want to post a screenshot of your rules so we can help you (upload the screenshot to a file-sharing site and then embed/post the link here). Based on what @Armelline wrote, the rule should be:
When Mouse Button is Down
When Attribute self.toggle (integer or boolean) is 0
Spawn Actor [actor name]
Change Attribute self.toggle to 1
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
You are the best @tatiang ! It is working now! )) THANK YOU VERY VERY MUCH!
You're welcome!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User