BoundingBox not getting full Model size

Just anchor the part and make it invisible and you dont have to set it as primary part.

It would be like:

model.StartPart.CFrame

without having to set it as a primary part

1 Like

Okay so this works, but it’s the same as the bounding box and it has gaps

1 Like

size.X / 2 or size.Z/2

wont work because the primary part is not at the very very end, there is still a bit there (assuming thats what the circles mean)

image

1 Like

What do you mean by at the very very end?

1 Like

That means that :GetExtentsSize isn’t calculating the size properly. Can you send a track section as an rbxm for me to test? Doesn’t have to have any decorations, I just want to test it out with your parts because on my side it’s working.

1 Like

randomstage.rbxm (6.1 KB)
it may be an issue with the stages themselves. The stages that are flat work, but the stages with a dip have gaps

1 Like

Roblox sets a size limit on parts. if your part isnt long enough its likely because it hit the size limit. :GetExtentsSize() will always calculate the correct size.

1 Like

Yeah, you didn’t mention that these track sections were 4000 studs long. The gap is happening because there’s a size limit of 2048. You can use SpecialMeshes to bypass this, but I’ll test before showing you.

1 Like

Shoot you’re right, my bad I forgot to mention how long they were.
So what can I do now?

1 Like

Yeah my fault. I tried before by combining all the stages into on model and getting the bounding box of one big stage but it didn’t stretch that long, probably should’ve realized then

1 Like

I’ve used BlockMeshes to bypass the part size limit.

Code:

local lastPart = nil

repeat 
	local stage = stages:GetChildren()[math.random(#stages:GetChildren())]

	-- Create stage
	local stagenew = stage:Clone()
	stagenew.Parent = workspace.Checkpoints

	table.insert(stages_added, stagenew)

	if lastPart then
		stagenew:PivotTo(lastPart.End.CFrame - Vector3.new(0,0, lastPart.End.Size.Z))
	else
		stagenew:PivotTo(workspace.FirstPart.CFrame)
	end

	lastPart = stagenew

	-- Create bounding box
	local cframe, size = stagenew:GetBoundingBox()

	local tpPart = Instance.new("Part")
	tpPart.Size = Vector3.one
	tpPart.Anchored = true
	tpPart.CanCollide = false
	tpPart.CFrame = cframe
	tpPart.Transparency = .4
	tpPart.Name = "Tp_Part"
	tpPart.Parent = workspace.Teleporters
	
	local blockMesh = Instance.new("BlockMesh")
	blockMesh.Scale = size
	blockMesh.Parent = tpPart

	game:GetService("CollectionService"):AddTag(tpPart, "CheckpointTP")

	-- Create flag
	local flagclone = flag:Clone()
	flagclone.Name = "Checkpoint_".. #stages_added
	flagclone:PivotTo(CFrame.new(stagenew.Start.Position) + Vector3.new(0,17,0))
	flagclone.Parent = workspace.Checkpoints

	task.wait()
until #stages_added == maxStages
1 Like

So if a player’s hrp touches the block mesh will a .Touched event detect it?

Not sure, but you can test it and tell me what happens. Also, if your goal was to do that all along, you should’ve told us. There are simpler methods to query if a player is in an area.

1 Like

Oh I see, how else could I detect if the player is X amount of the studs below the stage

1 Like

.Touched can also be manipulated with exploits and is unreliable in general

1 Like

Check their Y position.

Code:

local character = workspace.Whatever

if character.PrimaryPart.Position.Y < -100 then
	print("Below")
end
1 Like
if stagePos.Y - playerPos.Y > Threshold then
-- do stuff
end

image

as you can see from the image though, if you want it below the threshold wil have to be negative

1 Like

Wouldn’t it be the y axis not the x?

1 Like

Yeah, I made a typo.

1 Like

So to get the threshold. Should I again use bounding box the find the cframe of all the stages combined, then find the lowest point where there is not stages on that y axis?

1 Like