Announcement

Collapse
No announcement yet.

Missile ejection then ignite code needed

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

    Missile ejection then ignite code needed

    I am wanting to do presentation, am needing to have an object eject from launcher then have missile engine ignite few.. are there any blueprints that are already done that could be attached to a launcher and plugin a mesh projectile?

    Closest I have seen is this guys S-300 missile effect then ignite and head to target.


    #2
    I'd spawn the missle as a projectile with Z velocity, set it as homing set its target and use zero magnitude acceleration and fire off a timeline with a time of 3 seconds going 0-1 as "alpha" and in update use the alpha to multiply against the max speed you want the rocket to go and set it to the homing magnitude so it eases into homing on its target.
    Inphidel / Brian - Developer of Ultraball
    http://www.ultraballgame.com

    Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

    Comment


      #3
      what if I want projectile instead of just homing like ground to air missile just launch out and instead of firing straight instead do a climb into a ballistic arch in direction of an object that I have already placed on map?

      Comment


        #4
        Well being a missle your looking at it have propulsion if it's not guided then we need to use velocity at the start so it will reach its target. Since we wouldn't be changing its velocity once it's launched we could fake the look with suggested velocity node

        https://docs.unrealengine.com/latest...ity/index.html

        This returns the velocity to reach a vector from start and target. You can punch in the speed you want it to travel at such *** 3000 and it'll return the vector to put into the velocity of the orojectile and it will go up and torward its target to land at the destination
        Inphidel / Brian - Developer of Ultraball
        http://www.ultraballgame.com

        Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

        Comment


          #5
          ok and what setting would I input to have it use fire off a timeline of launching initial object with mass from canister and it going into igniting and going into suggested velocity node, rather noob to unreal 4 blue prints so still learning how to set things up.

          Comment


            #6
            Well I'd setup a blueprint like any other projectile . So when it spawns use event begin play to sequence out what I want it to do.

            Let's just start with it appearing out if works location zero.

            Set its orojectile velocity to somthing like Z 1500 it's enough to shoot upward out ofvthecdefaujt -980 gravity force. So when it spawns it's going upward immediately

            Event begin play, have it spawn a emitter at its locstion or use a scene component on its bottom to have a workd location to reference where the particle spawns to give the initial I blast look. Use a delay like 1 second next spawn another emitter at that location to give the effect its now shooting thrust to goto its target. Follow this with getting suggested velocity. Then set its velocity to that. It will then toss itself at the target.

            You'd want yo in projectile set it do it rotates to face its velocity so it aim in the direction its going.

            I'm not totally sure what the missle does that you want to emulate.

            But it's pretty straight forward.

            If your new to blue prints might want to try some tutorials to get familiar with spawning emitters and such.
            Inphidel / Brian - Developer of Ultraball
            http://www.ultraballgame.com

            Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

            Comment


              #7
              I managed to get it to spawn projectile it flies up under z axis then starts to fall back down but I cant figure out what value to set to have it then do timed set new constant velocity once its initial boost velocity stops and it starts falling backwards to then have it activate its new constant movement
              Last edited by AlbertFive; 04-10-2017, 03:01 AM.

              Comment


                #8
                This is currently how my projectile on fire is acting, on fire it goes up with set velocity on initial fire then starts to come back down without kicking in a second ignition of thrust that I have not been able to figure out how to set timer for kick in.

                Comment


                  #9
                  Originally posted by AlbertFive View Post
                  This is currently how my projectile on fire is acting, on fire it goes up with set velocity on initial fire then starts to come back down without kicking in a second ignition of thrust that I have not been able to figure out how to set timer for kick in.

                  Event tick Branch (bHasLaunched False) -> get actorvelocity -> break it -> get z velocity -> branch (is z velocity < 0) true -> Set bHasLaunched True -> Event (fire thrust?)

                  Event Fire Thrust -> Get Actor location, get target location -> Get suggested velocity return into -> get projectile movement-> Set Veloctiy. (this will launch the rocket at the target like a grenade so to speak.)

                  If your projectile movement node is setup right and you ahave it facing its velocity it should arch with its change in direction.

                  just note the engine and yuo might disagree on what is the front face of the rocket.
                  Inphidel / Brian - Developer of Ultraball
                  http://www.ultraballgame.com

                  Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

                  Comment


                    #10



                    I maned to get it to fire a second velocity after first one with delay but then it starts to fall down what setting should I then apply to then tell it to switch to continue thrust this is my current setup..

                    Click image for larger version

Name:	blueprint.jpg
Views:	1
Size:	299.2 KB
ID:	1126272

                    Comment


                      #11
                      I think the main question I have is it possible to have it time to turn gravity off for a projectile after it goes to second velocity burst?

                      Comment


                        #12
                        I built this for a hover tank prototype a while back. The way I built it was "kick" the missile out with an ejector (a single force-impulse) and start a timeline that animates when the engine ignites.

                        Once the engine ignites, I run the physics simulation for the missile in Tick(). I don't turn off gravity; instead I have the missile controller apply some amount of force "upwards" to counteract the gravity. I ended up building a control system very much like what you'd get for a real homing missile :-) The basics are a simple PID controller that takes course and heading-to-target as input, and outputs control surface angles. The "I" part of the equation is what ends up compensating for gravity.

                        To look good, I also had the missile seek a "higher point" for the first half of the flight trajectory, rather than aim straight for the target; else there's real danger of colliding with other things on the ground. This logic went into the "determine where the target is" code, which would add a Z value to the desired target position for the first half of the trajectory.

                        You don't even need many tweakables. What you need are:
                        - ejection impulse magnitude
                        - duration until ignition
                        - propulsion force
                        - control surface area (turns into torque magnitude)
                        - P, I and D tuning constants
                        - amount of Z to add for first part of trajectory
                        - what percentage of the trajectory uses the added-Z

                        Comment


                          #13
                          Originally posted by AlbertFive View Post
                          I think the main question I have is it possible to have it time to turn gravity off for a projectile after it goes to second velocity burst?
                          After the delay, set gravity enabled false on your missile should be that easy I believe.

                          Comment


                            #14
                            As a projectile if you do go the gravity method I believe you'd want to pull off of the projectile component and set gravity scale to 0
                            Inphidel / Brian - Developer of Ultraball
                            http://www.ultraballgame.com

                            Don't shy away from bugs in your game. Don't play it as intended. Break your game so you can fix it!

                            Comment


                              #15
                              Maybe kim jong un can help you with that!

                              Comment

                              Working...
                              X