Re-spawn actor to repeat same action when other actor is pressed

ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
edited November -1 in Working with GS (Mac)
Hi all

Please can someone help me with a actor issue

I have a actor button that is pressed which causes a bullet shell to spin across the screen (Actor name is bullet 02 and is located at x 65 / y -25. This is set up at present as a Boolean.

The problem I have is when I press the button it works fine the first time but I need it to put the bullet back again in its original position and be ready to appear when the box is pressed again.

I have tried turning the bullet 02 actor to 'false' again but obviously the actor isn't there anymore as its span off the screen.

Is there a way to keep re-spawning the bullet back in its original position and be fired again when the box is pressed again? (NOTE: this needs to be repeated all the time)

Any help would be great...being trying to fix for the last 2 hours...

Thanks guys.

It takes a Zombie to know a Zombie!!!

Comments

  • hotMagichotMagic Member, PRO Posts: 266
    So are you trying to spawn at a certain position, watch it fly, kill that one, then spawn a new one at the original position?
    If you wanted to do that, you could have a separate "manager" object that says, when true, spawn a bullet actor at x,y, then set to false after spawning.
    and have the bullet actor's default behavior be the movement to offscreen. And obviously kill it at the right time so you don't amass bullet actors.

    Is that what you intend to do?
  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Yeah, that's sort of it.

    After the button is pressed and the original bullet flies across the screen I want a new bullet to spawn at the original position and use the same attribute like the rotation and stuff...

    Can it be done?

    It takes a Zombie to know a Zombie!!!

  • ZombiebrainsZombiebrains www.zombiebrains.co.ukMember, PRO Posts: 296
    Need like this sort of thing

    1) Load scene
    2) User presses button
    3) bullet off screen flies across screen
    4) reload bullet again with all setting back at its original position ready for when the button is pressed again
    5) Repeat...

    Not easy I know but can it be done?

    It takes a Zombie to know a Zombie!!!

  • jbsitedesignjbsitedesign Member Posts: 25
    i think you can just create some attributes and store the values there mate.............then create a rule to change attribute position to the attribute values maybe?
  • hotMagichotMagic Member, PRO Posts: 266
    Yeah so what you're saying about original position in your number 4, that's something that gamesalad does well. Have the object's prototype contain all the settings as you want them, so that when it's spawned, it automatically does that thing.
    For example:
    Motion
    Heading,
    Maybe some particle effects behind it.
Sign In or Register to comment.