So let’s say, my game has streaming enabled, and I wanted to make an orb system
I will use partcache for this (partcache makes clones of the selected part and cframes them very far away, in my case i cframe them over the spawn point, and then parents them to whatever you set the parent) , let’s say I create a new cache of 40 orbs, parent them to a folder called OrbsFolder, now I’m gonna place them randomly around the map,
My question is, why do these orbs not get streamed out even though they’re out of streaming radius
those little dots are the orbs, they should not be visible to me, every orb in the cache folder is there, when it should not be there.
--small snippet of the code
local Utils = {
Maid = Loader.GetUtil("Maid");
PartCache = Loader.GetUtil("PartCache");
Character = Loader.GetUtil("Character")
}
local CoinsCache = Utils.PartCache.new(Coin, 70, Orbs)
function initOrbs()
for i = 1, 70 do
local orb = CoinsCache:GetPart()
orb.Name = "Coin"
orb.Position = getRandomPos()
List[orb] = true
end
end
function getRandomPos()
local PositionFloor = Vector3.new(Floor.Position.X, 0, Floor.Position.Z)
local YAxis = 160
local xSize = Floor.Size.X/3
local zSize = Floor.Size.Z/2
local Position = PositionFloor + Vector3.new(
math.random(-xSize, xSize),
YAxis,
math.random(-zSize, zSize)
)
local rayCast = workspace:Raycast(Position + Vector3.new(0,600,0), -Vector3.new(0,1000,0), Params)
if rayCast then
Position = rayCast.Position + Vector3.new(0,3,0) --same result without this raycasting btw
end
return Position
end