I have this slime collecting mechanic and I currently have 2 slimes modeled and textured, their meshsizes are diffrent so I sized slime1 to a size that I like took the size to meshsize ratio and multiplied the slime2’s size property by those values and managed to achieve two slimes with two diffrent meshsizes to be the same size. But when I do that slime2 spawns a little bit underground due to the spawning logic which is down here. I
SpawnEvent.OnClientEvent:Connect(function(SlimeBatch)
local List = SlimeBatch
if not SlimeBatch[1] and SlimeBatch.ID then
List = {SlimeBatch}
end
for _, SlimePacket in ipairs(List) do
local Config = SlimeData[SlimePacket.Type]
local VisualName = Config and Config.ModelName or SlimePacket.Type
local Model = GetSlimeFromPool(VisualName)
if Model then
local RandomRot = CFrame.Angles(0, math.rad(math.random(0,360)), 0)
local GroundCF = CFrame.new(SlimePacket.Position + Vector3.new(0, 0, 0)) * RandomRot
local StartCF = GroundCF + Vector3.new(0, SPAWN_HEIGHT, 0)
RenderedSlimes[SlimePacket.ID] = Model
SlimeTypeCache[SlimePacket.ID] = {Type = SlimePacket.Type, Zone = SlimePacket.Zone}
if Model.PrimaryPart then
Model:PivotTo(StartCF)
local BounceCF = GroundCF + Vector3.new(0, BOUNCE_HEIGHT, 0)
local Proxy = Instance.new("CFrameValue")
Proxy.Name = "TweenProxy"
Proxy.Value = StartCF
Proxy.Parent = Model
local Connection = Proxy.Changed:Connect(function(val)
if Model then Model:PivotTo(val) end
end)
local TweenFall = TweenService:Create(Proxy, InfoFall, {Value = GroundCF})
local TweenBounceUp = TweenService:Create(Proxy, InfoBounceUp, {Value = BounceCF})
local TweenBounceDown = TweenService:Create(Proxy, InfoBounceDown, {Value = GroundCF})
TweenFall.Completed:Connect(function()
if RenderedSlimes[SlimePacket.ID] then
ActiveTweens[SlimePacket.ID] = TweenBounceUp
TweenBounceUp:Play()
else
Proxy:Destroy()
end
end)
TweenBounceUp.Completed:Connect(function()
if RenderedSlimes[SlimePacket.ID] then
ActiveTweens[SlimePacket.ID] = TweenBounceDown
TweenBounceDown:Play()
else
Proxy:Destroy()
end
end)
TweenBounceDown.Completed:Connect(function()
ActiveTweens[SlimePacket.ID] = nil
Proxy:Destroy()
end)
ActiveTweens[SlimePacket.ID] = TweenFall
TweenFall:Play()
else
Model:MoveTo(GroundCF.Position)
end
end
end
end)
This block of gives the SlimeBatch it’s position info
local function GetRandomPosition(Part)
local Size = Part.Size
local CFramePos = Part.CFrame
local RX = (RNG:NextNumber() - 0.5) * Size.X
local RZ = (RNG:NextNumber() - 0.5) * Size.Z
return (CFramePos * CFrame.new(RX, Size.Y/2 + 1, RZ)).Position
end


