Announcement

Collapse
No announcement yet.

Projectile Speed based on progress bar

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

    Projectile Speed based on progress bar

    Hey, everyone, I'm building a game involving firing a shot from a cannon and I want to be able to have the projectile speed/distance be based on the progress bar, like turtle toss or kitten cannon. How can I control the power of the shot based on the progress bar?

    #2
    First you break your problem into simple tasks. For your game is "how umg works" and "how to shoot physics body"
    then google for tutorials about "unreal umg" and about "unreal physics"
    then you follow those tutorials, and finally you make your game.

    Comment


      #3
      I have the progress bar built and even have a slider to control the percentage of the progress bar just curious how to have my character fire further based on if the progress bar is set at 1% or 100%

      Comment


        #4
        I even have my character firing on a button clicked i just would like to tie in the progress bar to determine the distance and power

        Comment


          #5
          If your projectile is an actor and you are creating it using a "Spawn actor from class", you can set up a variable (probably a float) on your projectile actor that is "editable" and "expose on spawn". Then, wherever you run the "Spawn actor from class", you will be able to pass in a value for that float. In your projectile actor, on begin play, use the passed in variable to set the velocity in the projectile movement component. You could use the value passed in as a percentage and multiply it by a "Max Speed" to perform your calculation.

          Comment


            #6
            ill try that out thank you

            Comment


              #7
              Looks like you would need a BP/code that calculates that and can be accessed by everyone. Try doing this in GameMode.
              Check out my itch.io page, I'm really excited about it.
              https://kinos141.itch.io/

              Please check out my AI package: Action AI System Feat. Stealth
              https://www.unrealengine.com/marketp...m-feat-stealth
              or get it from itch
              https://kinos141.itch.io/action-ai-system-feat-stealth

              Comment

              Working...
              X