Unreal Engine 5.3 Planet Gravity System #1 - Custom Gravity

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • Project Files: / 96505428 .
    Today we are going to implement a custom character movement component that can be used with unreal engine character blueprints to simulate a planet gravity system. Usually, the default character movement components aligns with the z/up axis and still there is a way customize gravity direction inside the character movement component. This custom gravity feature is not exposed to blueprints. Today, we are going to setup a function to expose that gravity customization part with minimum C++ involvement so that we can simulate a planetary gravity system for characters in unreal engine without deviating much from the existing movement logic. So replication and everything that is built into the system by default will have a minimum impact in this system.
    Full Playlist of Unreal Engine Planet Gravity System:
    • Unreal Engine Planet G...
    Full Playlist of unreal engine 5 stellar objects:
    • Unreal Engine Stellar ...
    ► 👇 𝐒𝐮𝐩𝐩𝐨𝐫𝐭 𝐓𝐡𝐞 𝐂𝐡𝐚𝐧𝐧𝐞𝐥 // 𝐁𝐞𝐜𝐨𝐦𝐞 𝐀 𝐏𝐚𝐭𝐫𝐨𝐧!
    / codelikeme
    ►Patrons will have access to project files of all the stuff I do in the channel and other extra benefits
    Join this channel to get access to perks:
    / @codelikeme
    Like my facebook page for more content : / gamedevelopersclub
    Follow me on twitter : / codelikeme2
    Follow me on reddit : / codelikeme
    #CodeLikeMe #unrealengine #ue4 #indiegamedev

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

  • @WsEKond
    @WsEKond 8 месяцев назад +3

    Really cool tutorial! Hope you continue tomorrow with this series because this is one of your best series!🎉🎉🎉🎉

  • @activemotionpictures
    @activemotionpictures 11 дней назад

    13:46 - why did you cut this node's setup? You cut and went to game, fixing it off the video. This is an amazing tutorial, but it will not work if the fixes are not shown in the video.

  • @Siphonife
    @Siphonife 6 месяцев назад +3

    you glossed over the Component Class drop down for actually making the cast work. otherwise it just fails. Also your character orientates their rotation to the gravity automatically. Mine does not. trying to rotate the characters capsule results in nothing or it snapping for a single frame and going back to upright. Edit: I did get the capsule to rotate with the gravity.

    • @OuterCity
      @OuterCity 5 месяцев назад +2

      The cast does not show up at all for me. Where do I find the Component Class drop down?

  • @williamjames5321
    @williamjames5321 3 месяца назад +1

    using UE5.4.1, I have copied the code exactly as as copied in the video yet the blueprint will not allow me to access the function I have created. Does anybody have a clue as to why this is?

  • @gfilmstv5710
    @gfilmstv5710 3 месяца назад +3

    My cast keeps failing

  • @alexandrebrunet3528
    @alexandrebrunet3528 8 месяцев назад +2

    Have you tried to walk on the "side" of the planet (where the player is horizontal to the word). If so, can you tel me if exactly when the character is horizontal it starts playing the fall animation ? It may be easier to test on a small spherical planet than the one in the video
    Also, try to crouch / un-crouch on very south of the planet and see how it goes. I don't know if it's only me having the issue or other people as well

    • @lorryburger8165
      @lorryburger8165 7 месяцев назад

      I am experiencing a similar issue, as I approach the equator the movement in the Z axis slows

  • @lorryburger8165
    @lorryburger8165 7 месяцев назад +4

    If you use a smaller planet (sphere with radius 5000 located at 0,0,0), as you approach the horizontal equator (where Z = 0) the character slows down and stops moving in the world z axis

    • @CodeLikeMe
      @CodeLikeMe  7 месяцев назад +6

      I have fixed those issues down in the series. Keep following. This is only the 1st episode

    • @lorryburger8165
      @lorryburger8165 7 месяцев назад +1

      @@CodeLikeMe Thank you

  • @datfoo4065
    @datfoo4065 5 месяцев назад +1

    Would this system work with already existing replicated multiplayer code for a first person shooter

  • @aberryth_dev
    @aberryth_dev Месяц назад +1

    5:50 I don't even have a "component class"

  • @LittleBlue42
    @LittleBlue42 7 месяцев назад +2

    Wow so Epic actually implemented a gravity direction in the character movement component and all we have to do is expose it to bp?? I am using the free DirGravity plugin but if it now has a built in solution, i will switch over to remove the plugin

    • @CodeLikeMe
      @CodeLikeMe  7 месяцев назад +1

      It works fine so far for me. I implemented a transition of gravity from space to planet as well by the 4th episode of this series

    • @LittleBlue42
      @LittleBlue42 7 месяцев назад

      @CodeLikeMe cool stuff. I already have a gravity well actor and gravity well component for my game that I whipped up in c++. The component will add up the gravity forces of all overlapping gravity well actors. I have multiple planets in the game. I'm not sure where I will actually have more than 1 well "active" at a time but the option is there. That's something you could add to yours if it doesn't already support it.

  • @blakegt.7326
    @blakegt.7326 7 месяцев назад +1

    The problem is.... AI is not gonna be able to do the same, so... even when you can make a character to have gravity around a round mesh, enemies will not be able to be placed in that mesh and do the same.

    • @CodeLikeMe
      @CodeLikeMe  7 месяцев назад +4

      Why not?
      You may not be able to use AI navigation out of the box, but you can always implement a custom method for that

  • @marektachov9699
    @marektachov9699 Месяц назад +1

    I don't know how to edit code in C++ ( where and what to open ). it's stupid to use multiple monitors to record a tutorial when we don't know how and what you opened to edit the script. Visual studio doesn't show me what's in the tutorial. so almost useless.

    • @marektachov9699
      @marektachov9699 Месяц назад +1

      6:16 now lets go here ... Where is this? 7:40 how make this? for me visual studio does not give the possibility to create a new definition

  • @GES1985
    @GES1985 2 месяца назад

    For frame of reference, what planet radius sizes correlate to game worlds we would recognize? I want a game that would be about the same size as the planet in Everquest

  • @taoMi-jw4kx
    @taoMi-jw4kx 5 месяцев назад +1

    Why doesn't it work even though I followed the instructions? :(

    • @taoMi-jw4kx
      @taoMi-jw4kx 5 месяцев назад

      I figured it out I messed up one of the nodes

    • @CodeLikeMe
      @CodeLikeMe  5 месяцев назад

      nice

  • @alec_almartson
    @alec_almartson 8 месяцев назад

    This mechanic resembles Super Mario Galaxy's.
    Very cool Tutorial, Thank You.

  • @bdenix1997
    @bdenix1997 3 месяца назад +1

    by the way i upgraded to 5.4 you can access to SetGravity function in blueprints as well idk if this is new in 5.4 but yeah.
    no need to create cpp file anymore i guess.

  • @SeanMaxhell
    @SeanMaxhell 8 месяцев назад +2

    So, from what I can see, you have given up on floating pawn with gravity imposed by an add input vector directed towards the center of the planet, and you have implemented C++ allowing you to create a function that determines which direction gravity should go.
    However, does this gravity influence the entire "cosmos" or just the character in question?
    If I now add a second planet, while gravity points towards the first planet, don't I risk that all the objects on the second planet will be attracted towards the first?
    At the moment in my project what I'm trying to do, however, by making the floating pawn, with the add input vector in the direction of gravity, is more similar to that of a little space man with magnetic boots that make him stick to the surfaces, what they are.
    I have the problem of the steps, those of the stairs. if the riser of this step is at least double the radius of the character's capsule, (35*2) it is considered a wall and the pawn sticks to it, changing orientation.
    But if I find myself in front of a step of only 20cm, the strength of the input vector (-1) is such as to prevent me from climbing it or significantly slow down the movement of the pawn.

    • @CodeLikeMe
      @CodeLikeMe  8 месяцев назад +4

      I had used a line trace based system to detect forward and right vectors. Later on I figured out an improvement for that so it doesn't affected by the local changes of the terrain. I will share it sometime

    • @CodeLikeMe
      @CodeLikeMe  8 месяцев назад +2

      this system can also be changed to get affected by the closest planet though

    • @SeanMaxhell
      @SeanMaxhell 8 месяцев назад +1

      @@CodeLikeMe Ok, and what about if the planet wasn't spherical, or was it even a very irregularly shaped meteorite? Would the new system include these options?

    • @shadowgaminghd1115
      @shadowgaminghd1115 7 месяцев назад

      @@CodeLikeMewhen will that be?

  • @timbrazh8512
    @timbrazh8512 2 месяца назад

    My project not compiles after adding Movement class :(

  • @MightyMindsDev
    @MightyMindsDev 2 месяца назад

    How to maintain gravity when turning on ragdoll?

  • @robertrigopoulos1444
    @robertrigopoulos1444 8 месяцев назад +1

    Will you add a first person mode to this in the future?

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

    Hi, how are such planet terrains made? Did you use the WorldScape Plugin?

    • @CodeLikeMe
      @CodeLikeMe  6 месяцев назад +1

      Here I used voxel plugin. But later i developed a method to generate a planet using geometry scripts.
      check this video: ruclips.net/video/S7FbUNQsXts/видео.html

  • @789alizaidi
    @789alizaidi 8 месяцев назад

    amazing tutorial

    • @CodeLikeMe
      @CodeLikeMe  8 месяцев назад

      Glad you think so!

  • @neritonreis3340
    @neritonreis3340 2 месяца назад

    You have to make independent tutorials, not tutorials that force you to watch another video of yours!

  • @iPEMiC.
    @iPEMiC. 7 месяцев назад

    Do you have any video about Niagara position base dynamic please?

    • @CodeLikeMe
      @CodeLikeMe  7 месяцев назад

      i'm not sure what that means. can you explain more?