Announcement

Collapse
No announcement yet.

Cannons shooting in random angles

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Cannons shooting in random angles

    Hi everyone!

    I am a big fan of the old ps1 game Crash Bash and thought of trying to recreate the minigame "Ballistix" which were like a 4-man ping pong game.

    Anywho, I almost got it all working, I "Only" need to make some AI to play with, or even look into making it multiplayer, for fun.

    But right now, in every corner, there's a cannon that shoots balls into the arena. I want them to be able to shoot off the balls at random angles like -10 to +10 degrees to its normal angles, so they never shoot balls in the same direction every time.

    I thought about changing the balls actor blueprints Projectile components velocity, but I am not sure if its the right way to go, since all the blueprint logic is in the cannon actor.
    Though, I dont want the cannon mesh to visually rotate to the direction it shoots. Just make the ball shoot in random directions, like it had bad accuracy.

    Any of you got an idea as to how I could go about this?
    I also haven't quite figured out how to make the balls shoot out at random times, right now they just shoot out every 2 seconds. Would love an interval between 5-10 seconds randomly split between the 4 cannons.

    Anyway, heres some pictures of the arena and cannon blueprint.

    #2
    Okay, so I looked into making it shoot at random times with a random float in range. Problem is it is binded to an "Event beginplay"

    So as soon as the level plays, all cannons shoots once, then they all start to shoot randomly, ive tried different stuff, but I cant seem to get it to be random from the start.

    Any idea?

    Comment


      #3
      Alright, got the random shooting to work perfectly, it was stupidly simple after some head scratching

      Im still struggling with the event begin play thing.

      Comment


        #4
        Hah! I figured it out!
        Didn't realize I could randomize the delay in a tick event, to make it call out the shoot it event at random times!
        Totally did the trick!
        Thanks me!

        heres a picture to show it

        Comment

        Working...
        X