How do I fix the direction of a projectile?

So I'm making a shoot em up game, where a spaceship has to defend a planet, and I made an invisible wall that automatically shoots bullets every 3 seconds towards the planet. However, It shoots the opposite direction. I made it so it shoots to the left (towards the planet) and it shoots to the right? How do i fix this?

Best Answer

  • 3itg3itg Posts: 382
    edited February 2014 Accepted Answer
    Make the bullets as I described, then rotate the actor that is firing them.
    You can also change the "Direction" option on the spawn behavior.
    You could use something like random(0,359.9)

Answers

  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375
    Can you post a screenshot of your rules?
  • MichaelSillimanMichaelSilliman Member Posts: 31
    i fixed it. Somehow making the number a negative made it go to the left. But do you know how to make it automatically shoot bullets different directions? having it shoot the same way all the time makes it too easy.
  • 3itg3itg Member, PRO Posts: 382
    edited February 2014
    you can rotate the actor,
    you can make the value relative to scene, instead of to the actor or vice versa...
    but...
    I made it so it shoots to the left (towards the planet) and it shoots to the right
    It sounds like you made it so it shoots right, and it shoots right, so its right.
    I am pretty sure if you make it so it shoots left, it will.
    To accomplish this, I usually make my bullets move by using the move behavior, direction Zero, relative to actor, then I rotate the object firing it to shoot in the direction I desire.
  • MichaelSillimanMichaelSilliman Member Posts: 31
    Do you know how to make the bullets shoot at different angles every time they spawn?
  • MichaelSillimanMichaelSilliman Member Posts: 31
    Okay thanks for the help!
Sign In or Register to comment.