How do I get all Asset objects inserted in the game?

So I’m basically making a loading gui that preloads a table(Im actually using a folder filled with various assets) it’s categorized as animation, audio, textures, important assets. So it’s working as fine, but the problem is, I have tons! of assets and I don’t know how to copy paste all of them without them duplicating in the folder.

Is there a way to like filter objects in the workspace and only show one asset? because I have tons of duplicated textures.

1 Like

I’m not sure what you mean, could you provide more context?

If I’m getting what you mean, I don’t think there is a specific filter, but you can use the command line to log the assets?

You could also use the command line to take specific objects under a certain class.

for i,v in pairs(workspace:GetChildren()) do
    if v:IsA("Part") then
        print(v);
        v.Parent = workspace.BasePlate;
    end
end

You could also use GetDescendants()
Did I get what you mean wrong? please provide what you mean in a better way.

thanks for the code but that’s not necessary in my situation. I’ll explain it as best I can, I have 11 textures, they’re all over the game’s map, I want to get all the 11 texture’s into a Folder, I don’t know how, the filter workspace is showing every texture ive pasted on the map, I just want to see only/filter the 11 textures instead of all the 11 textures pasted all over the map

What is this “workspace filter”? How do you have it set up? Is it a table? is it strings or objects?

1 Like

I wouldn’t do this, you’re essentially going to clone everything, move it to a folder, when it’s done loading, move it to where it was.

A simpler method and solution is to just :PreloadAsync the entire map. (not workspace)
Just put everything and whatever that is important and needs to be loaded inside a folder.

2 Likes

Yes I want to put every asset that I need, but the problem is, I cant individually store all of them one by one because they’re so many. To simply explain for example, I want to preload the color green, but they’re all over the place and cannot all be pasted into a folder because you only need one part with the color green.

Same goes with the assets that I have, they’re so many, I can’t paste all of the duplicated textures into a folder because that would be massive, I only want one of each texture

I don’t understand what you’re trying to do. If “they’re so many”, then why don’t you just load the entire thing? You do know that you don’t have to do :PreloadAsync(“Green”, “Texture”, “bla”, “bla”).

Just :PreloadAsync(map) – assuming map is a folder and it’ll load everything.

Duplicated textures isn’t really an issue, cause it loads for the rbxassetid.

Sorry if I’m wrong, I’m just not understanding why you can’t do :PreloadAsync(map). Could you explain more about why?

If the map isn’t a folder he could get all the descendants of workspace and insert it into a table.

(If it’s required to have it out of a folder / model)

Well, I can do preload the whole map, but I just really prefer having 11 of my textures in a folder, because it’s satisfying to keep things organized

Could you take a screenshot of how your folders are sorted/organized?

usually if you want to preload assets, you use the preload service on folders containing examples for all the assets you wish to preload somewhere in storage

Cheap way of making these is to go through all things in the game and fill up folders with instances of specific types using a script

image

image

I have other folders to sort out later on, but thats about it, all that’s left are the textures

You could put all those folders under one folder called “Assets” or something, then :PreloadAsync(Assets) .

Also, if you want to make a progress bar without using the preload queue size thing, you can preload each object individually in the folder or each folder individually

1 Like

No I’ve already done that before I even posted this post, everything, the only thing I need to copy paste is all the textures, but they’re literally over a hundred duplicates. I want to only copy 1 and paste a texture for each ID

My program is already good nothing else is needed to be added, I just want to

“COPY ALL THE TEXTURES I HAVE INTO A FOLDER BUT THEY"RE SO MANY”

If you use a script you can do this by using a dictionary as if the id is already in the table, it will not be added like an array. then you can just put duplicates of all items in the dictionary into the folder (or place a duplicate of the asset if one hasnt been made already (not in the table) during the loop)

Example:

local lookup = {}
local addAsset = function(object, id, parent)
    if not lookup[id] then
        lookup[id] = true
        object:Clone().Parent = parent
    end
end

for _, storage in ipairs(storagePlaces) do
    for _, object in ipairs(storage:GetDescendants()) do
        if object:IsA("Sound") then
            addAsset(object, object.SoundId, folders.SFX)
        elseif object:IsA("MeshPart") then
            addAsset(object, object.MeshId, folders.Meshes)
        end
    end
end
2 Likes

well know what, I’m just gonna check each texture then paste them in the folder, It will take time but it’ll sort things out

for _,v in pairs(workspace:GetDescendants()) do
if v:IsA("Texture") then
v:Clone().Parent = workspace.Texture -- clone to texture folder
end
end

Is that what you want?

1 Like

Almost, I have 11 different textures, and they’re pasted on 100 surfaces, I just want the textures with different ID’s to be shown