I’ve been working on some kind of scrip that leaves behind a kind of path when the player walks (this happens in a serverscript). I start with the playeradded function to get the character, and then the humanoid (just incase i need that), together with the HumanoidRootPart. I constantly check the players position and do some maths on that position to get the position i really need; divide by 3 then .Ceil then multiply by 3 (so it acts like a grid). Now i’m able to place a part where the player stood.
Now here’s the problem: I don’t need a part to appear where there already is a part, else the game crashes due to too many spawning in… I don’t know how to check if there’s a part where the game is trying to place a part. Can somebody help me out? (i was thinking of using players position, but that would be hard. I was also thinking of using .Touched or even .TouchEnded… but you tell me)
Region3 only works reliably if the parts are not rotated (or at 90° steps) and of shape block (since these restrictions apply to Region3s respectively).
If so, FindPartsInRegion3 is probably a better solution since it doesn’t require spawning in parts and I’m positive it’s more performant too.
You can calculate the bounds for a given part like so: Region3.new(part.Position + part.Size / 2, part.Position - part.Size / 2)
Since the position describes the center, half of the size is exactly the distance you need to travel to reach a corner.