!Help! Need to Spawn 2x actor 2 after destroying actor 1
dabbuhl
Member, PRO Posts: 52
I am working on a game. I have actor 1, I made a rule that when you touch or mouse is pressed on actor 1, Spawn actor 2 (actually spawn 2 copies of actor 2), which does work, then destroy actor 1, this also works. So, when you click on actor 1, 2 actor 2s appear and actor 1 disappears. I wanted to add in multiple actor 1 to the scene, but when I do this, (let's say I have 4 copies of actor 1 on the scene) if I click on any of the actor 1, all of them spawn 2 copies and then destroy. I only want the one that I am clicking or touching to do this rule independent of the other actor 1s on the screen.
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
You need to use when touch is pressed or when touch is inside. If it doesn't work, post a screenshot of your rules or type them out exactly as they are and we'll go from there.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
At this point, it would be quicker for me to just preview the file and see why it's not working. Can you compress the project file as a .zip, upload it to a file-sharing service such as Dropbox or MediaFire, and then send me the link to download it (via private message or post it here)?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
https://dl.dropboxusercontent.com/u/43145818/bubble.zip
If you look in the attributes of the Bubble_large, you will see that I have it set to touch is pressed and to spawn 2 Bubble_medium, then destroy (this would basically be like asteroids by touching a Large bubble, it spawns 2 new Medium bubbles) but it does nothing. If I add the Mouse Down, it will do this function but all the large bubbles then do the function and not independently (which from all my reading is what should happen). So, why doesn't the touch is pressed work?
Also, if you change the Bubble_large Physics, collision shape to Circular, the bubbles just kind of stick to the walls. If you leave it to Rectangle (normal setting) it will bounce but if it is at the corner of the graphic (which is a square) it will bounce but looks like it is not touching.
Please let me know if you can help.
You'll notice that the rule conditions you have are When Touch is Pressed OR Mouse button is Down.
To explain, let me hand it over to someone who really knows about this stuff: You used both conditions which means that any time the person clicks anywhere on the scene, the actor with that rule will split into two new actors. You need to remove the Mouse button is down condition. With Touch is Pressed alone, it does work on Mac Creator at least:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Please help!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
the Windows version normally behaves the same as the Mac version. As @tatiang indicated, a "touch is pressed" should work for your purpose.
However, I tried your project and it seems to be corrupted. Even creating a brand new actor and rules inside your project shows this wrong behaviour.
If I create a new project all is fine and as expected.
I suggest you send your project to Gamesalad to have a look at. I had a quick look at the XML files and didn't find anything obvious, like duplicate Actor IDs.
If you are not too far with your project, try creating it totally from scratch.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com