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

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

like is there a plugin to show every different assets I have in the game?

function alreadyExists(texture)
    local exists = false
    for _,v in pairs(workspace.Texture:GetChildren()) do
        if v.TextureId == texture.TextureId then
            exists = true
        end
    end
return exists
end

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

2 Likes

you can just use a lookup table like in my example as its more performant and also works on multiple types as long as you just add them

1 Like

Yes this is what I need, Thank you