#never used a data asset, what is it?

1 messages · Page 1 of 1 (latest)

chilly crypt
#

@jolly flare Start with a data asset CLASS. Right click the content browser and go to Blueprint Class. You'll pick Primary Data Asset

#

I named this one B_WeaponDefinition. I put a few variables in it. Name, damage, clip size.

#

Right click the content browser again and make a new data asset by going here.

jolly flare
#

okay im on it

chilly crypt
#

You'll pick your asset type from that list

#

It'll go to the content browser where you can name it whatever you like.

jolly flare
chilly crypt
#

Open that up and you'll have all of your data for that weapon.

#

Now in any blueprint, or anywhere you can create a property. You can specify your data asset class just like any other asset like a texture or static mesh.

#

When you compile that, you can set it to a specific asset.

#

And then you have access to that asset's data.

jolly flare
#

nice ok, so to get specific weapon data i just need to change the data asset

chilly crypt
#

Correct. And it's common to specify the used actor and such. You'd make a B_AssaultRifle weapon, and put that in your data asset as a class. That way say you want to make a randomized weapon spawner. All you need is an array of pointers to the assets with the assets specified. Then you can pick a random one, get the weapon's spawned class from the asset and spawn it.

jolly flare
#

thanks man, i'll try to fully implement this new method, but this is exactly what i was looking for

primal badger
#

You can’t actually changed the stuff inside the DA at runtime tho right ?

chilly crypt
#

You cannot... Well, you can, technically. But generally speaking you shouldn't. The data won't persist, and as it's supposed to be static data it would change that value on everything using it.

primal badger
#

Thought as much, wanted to make sure