How to move duplicates of the same actor in different directions.

colejohcolejoh Member Posts: 0

I am making an arcade-like-shooter. To direct the bullet, I set the direction as the angle of where the user touches the screen. When I rapid fire, the bullets that were going to angle x change direction and go to angle y (second place user fired bullet). How can I make it so once a bullet has a direction, it stays that direction?


  • colandercolander Member Posts: 1,610

    It is hard to answer your question without knowing how you have setup your rules. Upload a test project and someone will be able to help you fix it.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,927

    You'll need to use a self attribute for the bullet actor. Call it something like self.direction and make it an angle attribute. Make a boolean attribute called self.locked. When the player touches the screen, change self.direction to the angle the bullet should follow and then hange self.locked to true. Make the rule for changing self.direction have self.locked is false as a condition. That way once the bullet picks a direction, it doesn't change ever again. You'll need to use self.direction as the direction angle for the Move behavior or whichever behavior you're using to make the bullet move across the screen.

    Also, this subforum is for PAID requests. If this not a paid request, please let me know. Are you using Mac or Windows Creator? I can move it to the correct subforum for you.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.