How could I shorten lines 7 and 8’s y values?
while true do
task.wait(5)
local rightCF2 = RootPartCF * CFrame.new(math.random(1, 5), math.random(-1, 4), -3.5)
local leftCF2 = RootPartCF * CFrame.new(math.random(-5, -1), math.random(-1, 4), -3.5)
local rightCF1 = RootPartCF * CFrame.new(math.random(2, 4), rightCF2:ToObjectSpace(RootPartCF):Inverse().Y - 1.5, math.random(1, 3))
local leftCF1 = RootPartCF * CFrame.new(math.random(-4, -2), leftCF2:ToObjectSpace(RootPartCF):Inverse().Y - 1.5, math.random(1, 3))
local CF3 = 'place holder value'
end
I am trying to make it so rightCF1’s Y value will always be 1.5 less than rightCF2’s Y value. This works however I wonder if there is another way that gets me the exact same results but uses less coding and is better suited for cases like these. What I did was I found the offset of rightCF2’s from the RootPartCF and subtracted 1.5 from that offsets Y value. (Same thing for leftCF1)