Fling Reset Projectile Help needed

Using the Hot Cross Bunnies tutorial files, I have my catapult setup and it shoots, I have a continue button that when clicked, it sets the next projectile to shoot. I also have my camera set to follow the projectile, when it shoots off screen and you click the button, it goes back to the catapult and you can shoot again. My problem is when the projectile stays on screen, my camera stays on it, not the new projectile in the catapult. It also messes with my touch screen scrolling.

I can’t figure out how to remove the shot projectile when you click the continue button.

I’ve included a test file to test and see it. If you shoot right there is a rectangle to hit to stop it so it stays on the screen to see what I mean. If you shoot it off left you can see how it works correctly when you click the continue button.

Here is the link http://dl.dropbox.com/u/41194248/test.zip

Thanks
Dan [import]uid: 78446 topic_id: 17946 reply_id: 317946[/import]

Try remove “local” from line 318 and then adding bullet:removeSelf() on line 637.

Peach :slight_smile: [import]uid: 52491 topic_id: 17946 reply_id: 68535[/import]

Thanks Peach.

Now why does it work by just removing the word “Local”?

Thanks
Dan [import]uid: 78446 topic_id: 17946 reply_id: 68665[/import]

Because with the way your spawning code is written the remove function is looking for the bullet but can’t see it as local. If you had tried to remove it without removing local you’d have got an error like “Can’t index global bullet”.

Peach :slight_smile: [import]uid: 52491 topic_id: 17946 reply_id: 68695[/import]