Hello! I am having a strange issue here. I am trying to create a game in which you consume objects as a hole. The problem is that I am not sure how to proceed with the growth system. You start as a 6 stud wide cylinder, however if you eat this bollard I have for example, it just adds the volume amount to your radius. The problem is that the radius is basically never accurate.
For example, if you have a cube which is 1x1x1, it would just add one stud to your radius, totalling at 7 studs, but it should be holevolume = holevolume + 1 (the area from above).
Does this make sense?
Video showcasing what I have so far.
local DeterminedValue = math.huge local area = math.huge local Consumeable = script.Parent:FindFirstChild('Consumeable') if Consumeable then if Consumeable.Value == true then local V3 = v.Parent:GetExtentsSize() -- the model (for this example the bollard) local X = V3.X local Y = V3.Y local Z = V3.Z area = X*Y*Z if Y > Z or Y == Z then print('Y') DeterminedValue = Y elseif Y < Z then DeterminedValue = Z print('Z') end end end
How the new size is determined:
Vector3.new(0.1, value.Value + area/2 --[[divided by two for the 2 axes]], value.Value + area/2) --value.Value is just the size of the hole which is stored in the player instance so I don't have to calculate the size every time
If you need any further explanation, let me know.