Unreal5 Blueprints: Static Mesh & Character Customization Arrays (2-MINUTES!!)

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ม.ค. 2025

ความคิดเห็น • 24

  • @TheRoyalSkies
    @TheRoyalSkies  ปีที่แล้ว +1

    I thought the code for this was gonna be much more complicated, but it turns out to be pretty straight forward, hope it helps-!!
    Full Playlist Unreal5 for those coming late can be found below!
    th-cam.com/video/Hn2aPOWsVzQ/w-d-xo.html

  • @mavencore3557
    @mavencore3557 ปีที่แล้ว +18

    Get actors of class is expensive and should never be used in event tick. You should store a reference to the character once at the start and just use the reference. I would also keep the change logic with in the actor actually doing the change and not the UI. Dunno if that's done here or not. The UI should just act as an interface to control logic in actors for things like this. In the UI, if the mesh is the players character, then you can easily get by calling Get Owning Player Pawn, from that cast it to that player character class and store the cast as a reference.

    • @HazmatPyro
      @HazmatPyro ปีที่แล้ว +4

      Get commands seem to be expensive in all engines. I know I've always been told to cache game objects if GetComponent will be used more than once for unity for example.

    • @mavencore3557
      @mavencore3557 ปีที่แล้ว +2

      @@HazmatPyro Well you should always keep Updates/Ticks minimal anyways, even use delays if not needed to update every frame. In unreal, some getter functions are just reference to object pointers and are fine to use every frame, such as get owning player in UI. I would still go ahead and make a reference to be safe. Most of the time, you need to cast it to your character class. Casting has some overhead but I still see people use it in event tick. I still recommend store it as reference. The reason Get Actors of Class is so expensive, is because it has to iterate through all actors in the level just to find an actor. Anything that does this kind iteration should never be used in update/tick, period.
      As for UI, I never use tick to update every frame. I use an isDirty method and delegates. IsDirty is just a bool that will get switched on anytime a delegate is called. Next frame the event tick will see if IsDirty is true then turn it off and then call the functions needed to update. This will ensure the update only calls once anytime a change is made on the next frame, even if there was hundreds of changes on the previous frame. This is the most optimized route.

    • @Mcl_Blue
      @Mcl_Blue ปีที่แล้ว

      Saving this.@@mavencore3557

    • @mavencore3557
      @mavencore3557 ปีที่แล้ว +1

      Also for people following this tutorial, just call all the logic from the button OnClick event instead of using event tick. I would also look elsewhere for a proper armor swap tutorial.

    • @mavencore3557
      @mavencore3557 ปีที่แล้ว

      @@RPG_Guy-fx8ns You should always keep in mind best practices. I know from experience that iterations like these can lead to massive frame lag. Even in a simple scene. For instance, using a pure function call that returns an array that is plugged into a for loop, this can lead to massive frame drops with just 30 elements. This is the reason it is best practices to store array outputs in a local variable before using a for loop.

  • @Mcl_Blue
    @Mcl_Blue ปีที่แล้ว +5

    Me: "But RS you shouldn't use Tick, it's expensive, blablabla!"
    Royal Skies, having put a disclaimer in the video: "NOT THIS TIME, DEMON!! I CAME PREPARED!!"

  • @alanvillarreales
    @alanvillarreales ปีที่แล้ว +2

    Thank you so much for these small tutorials!

  • @julianramirez8218
    @julianramirez8218 ปีที่แล้ว +2

    Great video! it would be cool a tutorial about modular characters, most tutorials only focus on the engine setup, but never from the planning and modeling side, how you plan a character to be modular, how you model it and split it in parts that makes sense, how you rig and export those models correctly, how you then create cloth or other meshes that follow and confom to the movement and deformation of the rig, and how other pieces can be attached to bones, there is not much info about it. Thank you for videos!!!

    • @TheRoyalSkies
      @TheRoyalSkies  ปีที่แล้ว +2

      Ahhh, I never thought of doing the modeling side, but you're right, there aren't a lot of vids covering that side of customization - I'll see what I can do in the future, thanks for the recommendation!

    • @HammerTime281
      @HammerTime281 ปีที่แล้ว

      @@TheRoyalSkies Second this, I'm going down the rabbit hole figuring out how to handle different armor in my game as a beginner.

  • @Valourn
    @Valourn ปีที่แล้ว +2

    How do you set-up the character in terms of the rig/weight painting to be able to change the helmets? Are helmets rigged/weight painted or just parenting it to head bone in Unreal, like you did in an earlier video, is enough? Thanks as always!

    • @TheRoyalSkies
      @TheRoyalSkies  ปีที่แล้ว +1

      There's a lot of different ways you can do it, but the way I find it easiest is to make it to where the helmet's are not weight painted outside, and just Parented to a bone in the Unreal Blueprint menu -

  • @benrickerson8230
    @benrickerson8230 10 หลายเดือนก่อน

    Can this be done if you want a static mesh (like a wall or door) to have different types of materials?

  • @cinderguard3156
    @cinderguard3156 หลายเดือนก่อน

    So how did you make that array. I cant find any tutorial on that.

  • @gabocavallaro
    @gabocavallaro ปีที่แล้ว +1

    u Hero!

  • @Kaapstad420
    @Kaapstad420 ปีที่แล้ว +1

    Are you working on a game yourself or just using unreal to make tutorials?

    • @TheRoyalSkies
      @TheRoyalSkies  ปีที่แล้ว +1

      I am working on a game, and I'm just uploading what I learn on the way to building the project :)

  • @РУССКИЙ_СОЛДАТ
    @РУССКИЙ_СОЛДАТ ปีที่แล้ว +1

    ...Event Tick 😁👍

    • @TheRoyalSkies
      @TheRoyalSkies  ปีที่แล้ว +1

      Yeah, I just use it for easy demonstration purposes, but definitely in a real project, would trigger it with something less expensive :)

    • @РУССКИЙ_СОЛДАТ
      @РУССКИЙ_СОЛДАТ ปีที่แล้ว +1

      @@TheRoyalSkies I just imagined some "potato-pc" exploding... 😅
      Thanks for your work, bro ! ✊