How To Create A Throwing Grenade Predicted Path Trajectory - Unreal Engine 4/5 Tutorial

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 67

  • @MattAspland
    @MattAspland  2 года назад +4

    Stream offers a free-forever Maker Account for qualifying small teams and personal dev projects - activate your Maker Account here: getstream.io/maker-account/?RUclips&Video_Ad&Developer&MattAsplandRUclips_July2022_MakerAccount

    • @peter486
      @peter486 2 года назад

      hey matt did you read about my request video? about roll on double tap. left and right side, that would be a nice video, as always thank you for all the stuff you upload.

    • @alexkerasidis
      @alexkerasidis 2 года назад +1

      Matt! Sorry, but... Could you make a tutorial solving something like this: So... I have a multiplayer shooter game. The widgets and everything work really well with the parent soldier class. However, the team children blueprints keep showing 0 health and 0 ammo, despite the fact that they have the amount of ammo I set and start with 100 health, and can get damaged. Could you please take a look at this? Thank you for your time.

  • @SlyBalto
    @SlyBalto 2 года назад +12

    Wow i had NO idea there was a built in system to predict projectile movement like this. Dude thank you for these insanely cool tutorials, you're the best bro 🙌

  • @adnanmujkic6697
    @adnanmujkic6697 Год назад +2

    The approach to constantly create and destroy spline mesh components will tank your (and players) fps drastically. Ideally get the MaxSimTime * SimFrequency as max number of points and on BeginPlay create all of the spline mesh components, store them in an array and set their visibility to false (and collision to false as well). Then every time you create points on the spline (in your tick function) just acess one of the spline mesh components on that index and set it's visibility to true. Make sure to iterate throught the spline mesh component array and set them to false on beginning of tick.

  • @Achillez098
    @Achillez098 2 года назад +3

    OMG this is exactly what I needed!
    I'm making a Gears of War styled 3rd person shooter tech demo. I managed to get the character animations, grenade spawning and attach to hand, and grenade detach and projectile movement all working. The only thing that was off was the trajectory of the grenade when thrown. Thank you so much Matt, you are an absolute life saver!

    • @MattAspland
      @MattAspland  2 года назад +2

      That’s amazing to hear mate, so happy I could help out! Sounds like an amazing project too, keep up the great work!

  • @Dicerox1
    @Dicerox1 2 года назад +6

    I haven't really used UE5 (as I work in UE4 atm), but I'd imagine the way you make the "nice trace" you wanted would be using a spline adjusted to the points with some cool material (and just hide/show and update based on IsAiming). I bet there are far more elegant solutions as well, like using only materials but the point was really to just give a really basic suggestion on how it could be done that should work fine for most circumstances. It's a bit nice listening to videos in the background when working though, every now and then you catch something new that's useful.
    Thank you for the entertainment! :)

  • @ashleyedwards9523
    @ashleyedwards9523 2 года назад +4

    Such a useful tutorial! Will definitely be using this one. Have you ever thought about making a tutorial series where you can implement many of the features you've covered to create a game? Would be so cool to see what you could make using all the stuff you've taught us so far :)

  • @nickkaverin
    @nickkaverin 2 года назад +6

    Bro you've just saved my nerves and time. Thanks a lot! Also, I can use this tut to throw a rock and distract an enemy, right?

    • @MattAspland
      @MattAspland  2 года назад +2

      Pleasure to help mate! And you absolutely can yes, this linked video should with that!
      ruclips.net/video/w0t75DdkazU/видео.html

  • @ef3353
    @ef3353 Год назад +3

    Creating/destroying that many objects every frame bad for performance so its better to just create like 100 objects in an array and move them to that location of the path (but it should be trivial enough but in case anyone else had that issue).

  • @eddysouth2023
    @eddysouth2023 16 дней назад

    This is really cool. I have a weird problem though where it will not give me a predictive path the first time I press. I have to press and hold for a while and move around before it gives me desired results. Not sure if it's a trace problem or what. Awesome tut though.

  • @LilMirka
    @LilMirka 2 года назад

    Can't wait for the tutorial (AI speed when player collects something)

    • @MattAspland
      @MattAspland  2 года назад +2

      I recorded that one the other day, it’ll be published on 29th July :)

    • @LilMirka
      @LilMirka 2 года назад

      @@MattAspland Yesss! Thanks!

  • @Lazyboyswift
    @Lazyboyswift 2 года назад +2

    Awesome video dude really appreciate it. How would i limit the amount of grenades i have? i tried the greater-than-zero variable but it doesnt stop the process when i run out of grenades it still spawns the trajectory
    Many thanks

  • @rlb1968able
    @rlb1968able Год назад +1

    Is there a way that you could pick up the grenade and then throw it?.
    And have an animation of you holding it

  • @the__jive
    @the__jive 2 года назад +2

    Great tutorial! Keep it up, Matt 😊

  • @pummelweed784
    @pummelweed784 2 года назад

    Finally the items my enemies drop don't just sit there static

  • @mojiacademy9400
    @mojiacademy9400 2 года назад +2

    Best grande tut so far

  • @thelostangel45
    @thelostangel45 9 месяцев назад

    And three, wonder if ill use your videos again. They're all very good tutorials.

  • @AtulSingh11
    @AtulSingh11 2 года назад +1

    thank you

  • @wesss9353
    @wesss9353 2 года назад

    Sweet
    Once I get stable again, this will be great for throwables

    • @MattAspland
      @MattAspland  2 года назад

      Awesome, can’t wait to see what you do with it!

  • @wolfiedgr8t
    @wolfiedgr8t 2 года назад

    Excellent Mat, can't wait to try this ❤️

  • @virgil258
    @virgil258 2 года назад +2

    What about the bounce prediction?

    • @MattAspland
      @MattAspland  2 года назад

      Great idea, I can look into it!

  • @sinistera1634
    @sinistera1634 Год назад

    Hey Matt, have you tried making a game yet or do you already have one that we can play or purchase?

  • @Phoenix4_Trade
    @Phoenix4_Trade 2 года назад +1

    Bro please continue in this things

  • @dangerousmindgames
    @dangerousmindgames Год назад

    Could you tell me how I'd get this trajectory prediction line when using add impulse instead of projectile movement? We're really having trouble figuring this one out. Thanks everyone

  • @developer_game12
    @developer_game12 Год назад +1

    Hi brother ! do you have the animation to download?

  • @shankark3250
    @shankark3250 Год назад

    Is there any reference to create a baseball hitting a ball then the ball flying in a tragectory
    Can you make tutorial on that

  • @DoomsDay117x
    @DoomsDay117x Год назад

    great stuff! thanks Matt

  • @mattr5413
    @mattr5413 2 года назад

    Trying to make an aiming system for a 2.5d side scroller any tips? (Wanting to aim at the mouse)

  • @ser6306
    @ser6306 Год назад

    hello there, what can I do to keep a decal on the ground after the bomb falls on the ground?

  • @nikita139a
    @nikita139a 2 года назад

    Hi! I did the doors according to your lesson from year ago, but there was a problem that you mentioned and promised to do the second part on this topic. Can you please help?
    "A second part will be released soon to fix a minor bug. If client 1 opens the door, and client 2 goes to close it. The door will snap closed then open again. This is a simple fix, we just need a replicated Boolean so each client knows if the door is already open or not"

  • @danielgbat89
    @danielgbat89 Год назад

    How can I spawn an actor where the granade hits the floor?

  • @arifemrecolbeyi
    @arifemrecolbeyi Год назад

    When I play the game my anim is not working. Even if ı create anim montage and add to blueprint... Please help :(

  • @ademegamer1254
    @ademegamer1254 2 года назад

    how to pick up and thruwing animation

  • @kenalpha3
    @kenalpha3 2 года назад

    Ty Matt. Can you please do a tut on SideScroller AI using this Predicted Path Trajectory (hidden) - to determine how to navigate (jump across) platforms, etc that are fundamental to the SideScroller genre????
    I asked many people on the market, they say no - dont have time. I searched the market - no one has done this for 5 years????? Epic refused to give us this in their SS example project. I do not understand why no one has done this fundamental AI navigation for a game genre that has been out since the 70s, 80s.
    But your example shows how it can be done - with the AI making sample calculations [using a parabolic arch] to determine if he can reach a jump.
    1) He has a sphere or cyl collision = if it touches geometry (a block or ledge is in front of him), or it stops touching geo (hole in floor/ceiling) - then AI performs the Parabolic check. (Or have AI doing seldom Para checks below - but he increases the tick of checks, if #1 - the sphere collision detects a change in geo.)
    2) Parabolic check = formula takes the AI's jump stats and does 3 invisible Para lines (tosses) - to see if AI should jump short, normal, or long - to reach the next platform.
    E.g. if Para short hits nothing (air = no platform) - then AI knows there is no close platform, and thus must check to jump farther.
    If Para long hits nothing - then AI knows he cannot jump far enough to reach anything.
    But if the end of Para long or short (where the imaginary "grenade" falls), hits something below - then AI knows there is a gap in platforms - yet there is also floor below to jump DOWN to. And this is how floors (elevations) of SideScroller genre work - with AI needing to know how to navigate up and down between holes in the floors, or jump across.
    (If you search the Market for Flying AI - someone uses a similar method where the AI makes frequent burst line-traces in front of him - to determine if he should go up,down, around. But the seller didnt want to make it for SS.)
    I know how to describe this, but not the code. So can you do it? ty.

    • @morganlak4337
      @morganlak4337 2 года назад +1

      You can use behavior tree tutorials for 3D characters and adapt them for side scroller. You'll want to use nav link proxy's to connect the platforms you want to be navigable, there's tutorials on doing this in 3D but it can be adapted easily for side scroller

    • @kenalpha3
      @kenalpha3 2 года назад

      @@morganlak4337 Thanks for the reply.
      1) "use nav link proxy's to connect the platforms"
      I have tried. Followed a few tuts to make custom BP Nav links. But it is buggy and idk why, I think it's an Epic code issue with how their Nav cylinder is setup - not clear to me exactly how low/high it wants me to plant the cyl into touching the Green Nav mesh bounds.
      The AI sometimes hits the Nav link and keeps hopping (stuck in a repeat jump loop). Or sometimes hits the Nav link and doesnt jump (to follow my char).
      2) And the main reason why I want AI hit detection for navigation (and not manually place Nav links) - is because if I want to make procedural levels - then I cannot know where to place all Nav links in advanced - for a level that has not been made yet.
      Thus I need smart AI that knows how to do hit traces to handle whatever geo is around him as he moves to/chases Player.

    • @MattAspland
      @MattAspland  2 года назад +1

      I can definitely look into it!

    • @kenalpha3
      @kenalpha3 2 года назад

      @@MattAspland Thank you :) Life [project] saver

  • @kevCarrico
    @kevCarrico Год назад

    thank you!

  • @teimurlu
    @teimurlu Год назад

    Thanks!

  • @cgs5428
    @cgs5428 Год назад

    The debug line shakes when the character moves. Is there a way to fix this?

  • @Ilaijo
    @Ilaijo 11 месяцев назад

    thanks

  • @randomd00d19
    @randomd00d19 Год назад +1

    For some reason I'm lagging when I got the trace.

    • @Gierownik_Studios
      @Gierownik_Studios Год назад

      same

    • @kingwrightdev
      @kingwrightdev Год назад

      @@Gierownik_Studios I am as well. It's not performant at all to be spawning and destroying the cubes constantly like that.

  • @shadow-krs
    @shadow-krs 2 года назад

    is it possible to calculate the trajectory using a target point, like if i want a trajectory to spawn from my enemy to target the player last location?

    • @MattAspland
      @MattAspland  2 года назад +1

      You wouldn't be able to do that via this system no, you'd need to do some maths for that.
      For example:
      The distance between the spawn point and the target, the velocity necessary to reach that distance, the angle needed, etc. There will be more going into it, but this is off the top of my head.

    • @shadow-krs
      @shadow-krs 2 года назад

      @@MattAspland gotta take a look at that

  • @silver_tongue9644
    @silver_tongue9644 2 года назад

    Hiya:)
    Ty for the great video
    I’m getting error notifications after I stop the game 3 for each grenade I throw
    Also when I fixed the mistake u made just at the end it made the grenades not fire, and only drop to the ground at my feet
    Any help would be appreciated
    Aphrodite
    the errors say:
    "invalid simulate options: Body (Grenade_bp) is set to simulate physics but Collison enabled in incompatible"
    twice and:
    "grenade_bp" has to have `collisionEnabled` set to `query and physics` or `physics only` if your'd like to AddImpulse." once

    • @krix5623
      @krix5623 Год назад

      Maybe you added the simulate physics on the mesh instead of the sphere collision, try it.

    • @krix5623
      @krix5623 Год назад

      or maybe you didn't connect all the white exec lines in the blueprint

  • @feuer_wasser
    @feuer_wasser Год назад +1

    cool, sadly it kills my fps

  • @sanogku474
    @sanogku474 9 месяцев назад +1

    pretty disappointing, the line does not update its rotation + destroying and instancing objects like that is very bad for performance

  • @greninjagreg6245
    @greninjagreg6245 Год назад

    I have a question with the prediction lines. So would something like this work for vr when your for example threw a bomb in vr could these lines somehow me made or would something like that be impossible. Only reason I wonder is because if I’m throwing something differently every time would something like that even be possible. If I did try that would the way the trajectory have to be fixed in order to do that or could I implement something where the line could changed based on the speed and power of the throw.

  • @blakenoxgama980
    @blakenoxgama980 6 месяцев назад

    i followed the video to the letter but my spawn emmitter is going off in front of the player character instead of where the granade is @mattaspland

  • @Phoenix4_Trade
    @Phoenix4_Trade 2 года назад +1

    Bro please continue in this things