How to compare 2 object sizes

so im making a game where everyone is a block and if 2 ppl collide, whoever is smaller dies, i have already made the eating thing, i just cant compare sizes due not being able to compare vector. like this part from it can anyone help me fix it:

        if hit.Parent.Block.Size > char.Block.Size then
			local p2 = hit.Parent:FindFirstChild("Humanoid").DisplayName
			game.ReplicatedStorage:WaitForChild("Big"):FireServer(hit.Parent, p2)
		elseif hit.Parent.Block.Size < char.Block.Size then
			local p2 = char:FindFirstChild("Humanoid").DisplayName
			game.ReplicatedStorage:WaitForChild("Big"):FireServer(char, p2)
		end

Couldnt you just do:

local HitSize = hit.Parent.Block.Size
local CharSize = char.Block.Size

if HitSize.Y > CharSize.Y then
    -- Hit size is bigger
elseif HitSize.Y < CharSize.Y
    -- Char size is bigger
end

1 Like

um lemme check rq if this works

i was thinking about doing X before i saw this but then i just used this format thx

1 Like

Considering the size is a cube, it wouldnt matter if you used X, Y, or Z, considering they’d all be the same size, why was just the closest to my finger lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.