Make actor shoot left or right

I tried searching for this but didnt come up with anything that worked. I have an actor that i need to shoot right when facing right and shoot left when facing left. I made a rule in the bullet that uses an attribute faceleft or faceright. right now when i shoot the bullet stays in center of actor until you press left or right and the bullet follows the actor. how do i fire a bullet and let it continue the way it was shot?

Answers

  • grimtoothgrimtooth Member Posts: 69
    edited May 2013
    ACTOR: GUN
    -Group
    -Rule-
    -When [ALL]
    -Keypress(Fire)
    -Boolean(FacingRight) = True
    -DO
    -Spawn Actor (Bullet)
    -In Direction 0

    -Rule-
    -When [ALL]
    -Keypress(Fire)
    -Boolean(FacingRight) = False
    -DO
    -Spawn Actor (Bullet)
    -In Direction 180
    -/Group

    ACTOR: BULLET
    -MOVE
    -In Direction 0
    -Relative to Actor

    (changing a boolean from true to false on the prototype does not change it on the instance actor... so make sure you are manipulating your instance actor when testing)

    Grim
  • grimtoothgrimtooth Member Posts: 69
    Oh and for Faceright... that should be on your gun or actor who shoots the gun... just add a change boolean true/false into the actors movement rules

    when the actor is moved right it will stay true until the move left button is hit, and then it will stay false until the move right button is hit again
  • UtopianGamesUtopianGames Member Posts: 5,692


    If your still stuck i will have a look to see how i did it but the above sounds good to me.

    Darren.
Sign In or Register to comment.