Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. How do I make a character shoot in the direction I drag him

How do I make a character shoot in the direction I drag him

Scheduled Pinned Locked Moved Help and Support
6 Posts 3 Posters 1.9k Views 1 Watching
  • 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.
  • MiniwolfenM Offline
    MiniwolfenM Offline
    Miniwolfen
    wrote on last edited by Miniwolfen
    #1

    So I have a game where what I want is to be able to have a character that's shoots in the direction I drag him. When I drag him at the moment in any direction he shoots from the top, bottom, left and right at the same time. How do I make it so that when I drag him up he shoots up and vice verse

    Aidan_FireA 1 Reply Last reply
    0
    • MiniwolfenM Miniwolfen

      So I have a game where what I want is to be able to have a character that's shoots in the direction I drag him. When I drag him at the moment in any direction he shoots from the top, bottom, left and right at the same time. How do I make it so that when I drag him up he shoots up and vice verse

      Aidan_FireA Offline
      Aidan_FireA Offline
      Aidan_Fire
      wrote on last edited by Aidan_Fire
      #2

      @miniwolfen Does the character move when you drag it, or it stands still but dragging in a direction makes him shoot? Is it using the drag and drop behaviour? I would do it differently depending on what exactly is happening.

      MiniwolfenM 1 Reply Last reply
      0
      • Aidan_FireA Aidan_Fire

        @miniwolfen Does the character move when you drag it, or it stands still but dragging in a direction makes him shoot? Is it using the drag and drop behaviour? I would do it differently depending on what exactly is happening.

        MiniwolfenM Offline
        MiniwolfenM Offline
        Miniwolfen
        wrote on last edited by
        #3

        @aidan-oxley it moves and shoots when I drag it

        Aidan_FireA 1 Reply Last reply
        0
        • MurtazaM Offline
          MurtazaM Offline
          Murtaza
          Admin
          wrote on last edited by
          #4

          We need more information than that to really help you come up with a solution. There are many different ways of doing this and a lot depends on how your game is currently created and what you want the outcome to be.

          From your first post we get that it shoots when you drag. But answering each of aidians questions will really help get you the best answer.

          Try to be as detailed as possible since we are not seeing your project or in your brain to know what you’re trying to accomplish :).

          1 Reply Last reply
          0
          • MiniwolfenM Miniwolfen

            @aidan-oxley it moves and shoots when I drag it

            Aidan_FireA Offline
            Aidan_FireA Offline
            Aidan_Fire
            wrote on last edited by Aidan_Fire
            #5

            @miniwolfen Ok, made an example project, involves a bit trigonometry, here's a link: http://bit.ly/2BeWmyb
            Object just shoots every 0.5 seconds, once you start dragging it, it starts shooting in the direction it is moving. The object has to be physics for this one to work.

            I'm not sure whether it will work or not for you since I made it in the beta version, but you might be able to look at the behaviours inside the red square (the label does nothing useful at all). If you can't, tell me and I'll screenshot it for you.

            If you want, I can modify it to also make the bullet shoot faster depending on how fast you are moving. But this also depends on how fast your bullet is, if it's really fast then there's not much point doing it if the player is quite slow in comparison.

            MiniwolfenM 1 Reply Last reply
            0
            • Aidan_FireA Aidan_Fire

              @miniwolfen Ok, made an example project, involves a bit trigonometry, here's a link: http://bit.ly/2BeWmyb
              Object just shoots every 0.5 seconds, once you start dragging it, it starts shooting in the direction it is moving. The object has to be physics for this one to work.

              I'm not sure whether it will work or not for you since I made it in the beta version, but you might be able to look at the behaviours inside the red square (the label does nothing useful at all). If you can't, tell me and I'll screenshot it for you.

              If you want, I can modify it to also make the bullet shoot faster depending on how fast you are moving. But this also depends on how fast your bullet is, if it's really fast then there's not much point doing it if the player is quite slow in comparison.

              MiniwolfenM Offline
              MiniwolfenM Offline
              Miniwolfen
              wrote on last edited by
              #6

              @aidan-oxley thanks

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Search