#Dragons spawning waay off where supposed to

1 messages · Page 1 of 1 (latest)

solid smelt
#

okay so i have this script
but some dragons spawn at like -510 y position like waaaay under the map does it have smth to do with primary part or position
script is too long so heres a paste bin https://pastebin.com/6CJwwWic

rain surge
#

or you could just use raycasts to get the ground, and spawn it there

solid smelt
#

idk how tho me still bad

#

and im in the middle of a 7 days challenge

#

@rain surge

left gazelle
solid smelt
solid smelt
left gazelle
cedar willow
#

why in getLowestY:

local function getLowestY(model)
local lowestY = math.huge
for _, part in ipairs(model:GetDescendants()) do
if part:IsA("BasePart") then
local partBottomY = part.Position.Y - (part.Size.Y / 2)
if partBottomY < lowestY then
lowestY = partBottomY
end
end
end
return lowestY
end
You need for cycle?
You putting in there only one part/model which need to be teleported. I tried with it, spawning in -inf. I Removed for cycle:
local function getLowestY(model)
local lowestY = math.huge
local partBottomY = model.Position.Y - (model.Size.Y / 2)
if partBottomY < lowestY then
lowestY = partBottomY
end
return lowestY
end
And spawning correctly

solid smelt
#

it tells me now

solid smelt
solid smelt
#

@left gazelle ```lua
local function getLowestY(model)
return -model:GetExtentsSize().Y
end

#

holy shit

#

i forgot to anchor spawningzone

#

...

#

well good news problem fixed