Weird Missile Behavior

CaramelTigerClanCaramelTigerClan Member Posts: 143
edited November -1 in Working with GS (Mac)
Here is my problem my fellow GameSaladians,

I have a scrollable game in which you press a button to make the ship shoot a rocket. The button is on a non-scrollable layer, but it creates the rocket on the non-scrollable layer as well! Our game is surely doomed unless we can make that button spawn the rocket on a scrollable layer.

Are there any fixes to this?

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    Make an attribute called 'shoot missile'

    Have a rule on the button that when it's pressed, shoot missile is true, otherwise it's false

    Put the rocket spawn on your ship.

    Have a rule that says 'If shoot missile = true'
    then spawn actor missile

    Hope that helps!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • CaramelTigerClanCaramelTigerClan Member Posts: 143
    Thanks so much for answering my question QS. Well, I tried your fix and let's say it kinda worked.

    Ok, here it is, I spawn the missle actor from my player chacter no problem. The missle actor then tracks the npc actor as commanded. Once the two actor connect they both explode as ordered. Here the problem, the npc actor then despawns but the missile actor just hangs there and will not despawn!?

    Ack! I've tried racking my brain and cannot figur this out. How do I make my missile actor despawn after it has preformed it's task?

    Any help will be welcomed :)
    thank you
  • reddotincreddotinc Member Posts: 653
    what you need to do is add a rule on the missile actor to say "if overlap or collide with actor of type npc actor"

    then

    destroy this actor

    that will destroy the missile at the same time as the npc actor

    // Red Dot Inc
  • CaramelTigerClanCaramelTigerClan Member Posts: 143
    what you need to do is add a rule on the missile actor to say "if overlap or collide with actor of type npc actor"

    then

    destroy this actor

    that will destroy the missile at the same time as the npc actor

    // Red Dot Inc

    Well, thank you for your response, Red Dot.

    But this has already been tried, it ends with the asteroid being destroyed and the missile is left hanging there half the time.

    This is rather baffling, it doesn't make any logical sense. Is this a possible bug in GameSalad?
Sign In or Register to comment.