WTF Is? Data Asset in Unreal Engine 4 ( UE4 )

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

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

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

    Thanks to the feedback here and some more research we were able to get the entire feature set of Data Assets working with Blueprints only using the Primary Data Asset class. You can see a followup video here: th-cam.com/video/hcwo5m8E_1o/w-d-xo.html

    • @DurgasiMuralidhar
      @DurgasiMuralidhar 2 ปีที่แล้ว

      Hey Mathew, how can we access the "Two Data Assests" in single pak file

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

    When you are creating your Data Asset class if you inherit from Primary Data Asset instead of Data Asset it becomes Blueprint friendly and you don't have to worry about C++. Good video! Great info!

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

    This tutorial was more effective at explaining Data Assets than the 3 official Epic talks on the ARPG sample project combined. Godspeed to you sir!

    • @vegitoblue2187
      @vegitoblue2187 2 ปีที่แล้ว

      epic did improve on teaching stuff lately

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

    I managed to make this fully work using blueprint:
    Step one: Create a Blueprint from the "PrimaryDataAsset" class, set whatever values you want in here
    Step two: Right-click> misc >create data asset file and assign the previously created PDA asset
    Step three: In whatever blueprint you want, create a new "PrimaryDataAsset" object reference and compile
    Step four: select your Data asset from the drop-down list
    Step five: From here you can do whatever you want with it, you can read variables, you can set them and they will stay like that
    I hope you find this helpful!

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

      Oh and I tweaked this settings as well: i.imgur.com/vVakIP6.png

    • @cActUsjUiCe92
      @cActUsjUiCe92 5 ปีที่แล้ว

      Do you know if that method works in 4.16? I haven't had any luck thus far

    • @MarcoMariaRossiArte
      @MarcoMariaRossiArte 5 ปีที่แล้ว

      @@cActUsjUiCe92 no, 4.22 only

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

    Thanks for the feedback and mentioning that yes you can create a "Primary Data Asset" derived class to use as a Data Asset parent in the editor to skip the C++ part =) This does work for the basic Data Asset abilities such as getting variables from them and calling functions. The downside I can see to this is as of this time, version 4.22, you cannot get these BP derived Data Assets to show up properly in the Asset Manager which removes some of the usefulness =( If anyone does know the proper way to get them to show up properly in Asset Manager alongside other C++ Derived Data Assets I would be more than happy to make a follow up video showing how to completely skip over the C++ part of this requirement. This video took so long to actually come out due to me hoping they would eventually remove the C++ requirement but I have yet to figure that part out.

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

      I was struggling with this a while ago too but I've just revisited the same problem again with a clear mind and managed to solve it pretty easily. You can call GetAssetsByClass on the AssetRegistry where I was going wrong last time was not passing in the right class name. If you named your PrimaryDataAsset ItemAsset then the class name to pass in would be ItemAsset_C I'm not to clued up on what the _C represents I just got this name from hovering over the asset in the content browser.
      This works for finding subclasses too (PrimaryDataAsset -> ItemAsset -> [WeaponAsset | PotionAsset])
      You can see the blueprint graph I used to test this here ibb.co/XDBZMxf

  • @dreamrider7128
    @dreamrider7128 2 ปีที่แล้ว

    this video just saved me from going crazy, didn't know that I had to update project settings for these to work; I was even starting to copy paste script by script the action RPG template just because I couldn't get the data asset to work on my own project, now I can continue working on it normally. Thank you very much

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

    For anyone wondering why they can't make a variable with the type of your new Data Asset, you need to make sure the Uclass is "UCLASS(BlueprintType)"
    When you make one it doesn't do this by default and while you can't make a DA in the new type, you can't make a variable of that type without this.

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

    Sir, thank you for these WTF vids. They are incredibly informative and simple to follow for beginners like me.

  • @geniuspancake8274
    @geniuspancake8274 3 ปีที่แล้ว

    I just want to thank you for this. Perfectly understood what it does and what's it uses are.

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

    You can do this in Blueprint you can use a PrimaryDataAsset

  • @FrancoSciaraffia
    @FrancoSciaraffia 5 ปีที่แล้ว

    At first I was like "Why not use a data only blueprint, or a Data Table?" and then I realized this is embedded into the whole Asset Manager System and it made sense!
    I definitely need to read up on that. It was introduced in 4.17 if I recall correctly. Has a ton of cool features any "real" game should be using.

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

    thank you Milord for great explanation🙇‍♂

  • @angrybonobro8711
    @angrybonobro8711 4 ปีที่แล้ว

    Your channel is awesome, thanks for doing this for the community =)

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

    as mentioned below, you cant have a DataAsset variable type, so use Primary Data Asset for the base class

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

    Really clear. Thanks!

  • @ShereefHisham
    @ShereefHisham 3 ปีที่แล้ว

    This really did help me a lot .. Thanks man

  • @rudyh9188
    @rudyh9188 5 ปีที่แล้ว

    You had be clear at 1:34, so it's possible to write in a data asset variable 2:30 ??
    I try to figure out how applying damage to an Enemy's baseHP variable ?
    Anyway data asset look super usefull ! Thank you !

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

    Data assets == scriptable objects In unity just what I was looking for

  • @goldennboy1989
    @goldennboy1989 2 ปีที่แล้ว

    Thanks man! I've been using structs and datatables before I learned about this >_

  • @commandertash
    @commandertash 5 ปีที่แล้ว

    Question: There is the way to create DataAssets without any Code (described below). Are there any drawbacks if not using C++?
    Method to create DataAssets:
    If I rightclick in the Content Browser and create new Blueprint and search for the Class PrimaryDataAsset, I can create a PrinmaryDataAsset. When opening it like a normal Blueprint I can specifie it's default Variables. Then, if I go under Miscellaneous I can select the just created PrimaryDataAsset. There is no C++ involved in the process. Am I missing any drawbcks?

  • @darodism
    @darodism 3 ปีที่แล้ว

    Working within a Mod for UE4 they use Data Assets. Ever since they switched to this method most/all modders been having difficult time setting up.
    Is it because we have to set up the Data asset with this method w C++ or can we simple just right click>misc.>Data Asset and its ok?

  • @simonesc5313
    @simonesc5313 4 ปีที่แล้ว

    really nice video, thanks. Super usefull!

  • @BrunoCaxito
    @BrunoCaxito 5 ปีที่แล้ว

    Thank-you very much Mathew.

  • @AL-bh2ws
    @AL-bh2ws 4 ปีที่แล้ว

    Is there a way to use Data Asset to select objects in the editor? If give a set of SMs a data asset called "organics" could I select those somehow?

  • @noname2031-w5r
    @noname2031-w5r 2 ปีที่แล้ว

    the way you say " That contains ..... DATA... " Freaks me out :D

  • @torgath5088
    @torgath5088 2 ปีที่แล้ว

    I've been always wondering where's video 3 and 5 after the intro

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

    The github link to this no longer seems to be working.

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

    I meaning it's easier with Structure + Data Asset to my mind ^^.

  • @Mantikator
    @Mantikator 3 ปีที่แล้ว

    Great information, thanks!
    Sounds like it was recorded in 2001, though :P

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

    So why not just use a datatable instead? If we can't edit the data asset on runtime, then what is the point of using them.

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

      data tables can't be edited on runtime either. It's all for organization purposes.

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

      Same, also I can just edit a Datatable in Excel or Text Editor, instead of using VS which is way more inconvenient.
      I don't see the point of using Data Asset

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

      You can set a data asset as a property. Let's say you have items, you want to have their name, description and attriubtes, then have some chest that gives an items. Then you can have a uproperty in your chest that wants an array of item data asset, so you can tell what's in that chest. If lets say "health potion" is in multiple chests, multiple shops, multiple "enemy drops", if you want to modify "health potion" you just modify the data asset.

  • @ElodinMaster
    @ElodinMaster 5 ปีที่แล้ว

    How does the ListAssets button work?

  • @misguidedgames6461
    @misguidedgames6461 5 ปีที่แล้ว

    Can you have a Data Asset reference another data asset?

  • @sergeyfilin5204
    @sergeyfilin5204 2 ปีที่แล้ว

    Great! Thanks!

  • @philzan3627
    @philzan3627 2 ปีที่แล้ว

    Why use this instead of datatables? :/

  • @oldsport
    @oldsport 2 ปีที่แล้ว

    So basically the unreal engine version of unity's scriptableobject

  • @kenanfatihsencan3941
    @kenanfatihsencan3941 2 ปีที่แล้ว

    so simply data asset is useful for using C++ and bp together and useless for only Blueprint developers

  • @windflier1684
    @windflier1684 5 ปีที่แล้ว

    I can just edit a Data Table in Excel or Text Editor, instead of using VS which is way more inconvenient.
    I don't see the point of using a Data Asset.

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

    so, basically no reason to favor data assets to data tables, since your points are weak. also converse is true, why on earth data tables were created then? junk chinese architecture.