logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Passing a Ball

    Scheduled Pinned Locked Moved
    Help and Support
    4
    5
    287
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Aaron Cunn
      last edited by

      Hello, is anyone able to inform me on how to pass a ball from one joystick controlled player to another. This would be used in a NRL based game where you can only pass backwards. Would this also be allowed to be interceptable. Any replies will be greatly appreciated.

      1 Reply Last reply Reply Quote 0
      • Aidan_FireA
        Aidan_Fire
        last edited by

        I'm not sure exactly how your game works, but if the joystick controlled players and the ball are physics objects, you could have something like weld attach ball to the player holding it, when he throws it then detach the object and apply a force in the direction he throws it. Then to catch it the other player would weld attach it when it collides with them. It might look stupid because the ball would look like it just sticks to them wherever it hits the player. I hope this makes sense, if not could you give some more info?

        iTap DevelopmentI 1 Reply Last reply Reply Quote 0
        • iTap DevelopmentI
          iTap Development @Aidan_Fire
          last edited by

          @Aidan-Oxley so the ball doesn't stick to the player anywhere, you could have it move to the characters hands or something when it collides, and then weld attach.
          I don't know how well it would work if the character is moving.

          Aidan_FireA 1 Reply Last reply Reply Quote 0
          • Aidan_FireA
            Aidan_Fire @iTap Development
            last edited by Aidan_Fire

            @iTap-Development Yeah. You could even just turn on a timer for the ball to just move to the player at an anchor (timer 0s).

            1 Reply Last reply Reply Quote 0
            • MurtazaM
              Murtaza Admin
              last edited by

              Here's what I sent to your email. Posting here since it may give other users an idea. It's not a fully fleshed out method, but I think the concept is sound.

              If you only want to be able to pass backwards, you can use a behaviour like calculate direction (may be renamed to calculate angle, cant remember).
              to figure out where the team mate is in relation to the player. If they are behind, then turn on the "pass button" behaviours.
              This concept requires some math and calculations to get right. But I think that is one way that may work. Or at least it's an idea on how to get started.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post