Objects Group/De-Group using Trigger OR Static Motion Path OR Reset Motion Path Starting Point?
Imagine a spaceship (image object) that the user can move (left/right/up/down) with arrow keys. Four simple triggers achieves this easily.
Now imagine getting this ship to "fire a bullet". Although there are many ways to achieve this - I can't seem to crack it. By adding a second image (the "bullet"), and grouping it with the space ship, it's easy to have it move around with the ship. This allows it to fire from the current position of the space ship, moving up in a straight line (when the users presses space bar for example).
However - while the bullet is travelling upwards on it's motion path, if the user presses arrow keys to move the space ship, the trajectory of bullet also moves left/right with it.
How can I get the motion path to stay static in this scenario?
I tried using a true/false variable to report the current fire state. Then for the movement triggers, I used the following conditions:
- If firing state = true, then move the group (ship + bullet) when users presses key.
- If firing state = false, then move only the ship (object within group).
However the bullet doesn't "shift back" to the ships new position after it's motion path completes, and the two (ship/bullet) become out of sync/position with each other as the ship moves around.