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
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
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)
What do you mean by at the very very end?
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.
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
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.
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.
Shoot you’re right, my bad I forgot to mention how long they were.
So what can I do now?
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
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
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.
Oh I see, how else could I detect if the player is X amount of the studs below the stage
.Touched can also be manipulated with exploits and is unreliable in general
Check their Y position.
Code:
local character = workspace.Whatever
if character.PrimaryPart.Position.Y < -100 then
print("Below")
end
if stagePos.Y - playerPos.Y > Threshold then
-- do stuff
end
as you can see from the image though, if you want it below the threshold wil have to be negative
Wouldn’t it be the y axis not the x?
Yeah, I made a typo.
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?