How to detect if a spot is occupied

I am currently working on a roleplay game. I am in the stage of working on major systems. Currently, my problem is detecting whether a spot is occupied (this is for a car spawner to make sure the car doesn’t spawn on top of someone else’s car). The system I currently am testing is using Touched and TouchEnded. However, I have found this to be very inaccurate. Sometimes it works perfectly and other times it doesn’t all. I took a look into Zone+ however there is no way to get parts inside of a zone only players (that I believe of) using Zone+. I am wondering how I should approach this problem?

I am not familiar however I have experienced people use Region3 before.

You can just check if there is a specific part that all vehicles will have. i.e.
You can use the

Workspace:FindPartysInRegion3(

for this

local part = game.Workspace.C
local region = Region3.new(Vector3,new(2, 3, 4), Vector3.new(8,6,5))
game.Workspace:FindPartsInRegion3(region, part)

Or using the example with Whitelists (from documentation)

parts = workspace:FindPartsInRegion3WithWhiteList(Region3.new(Vector3.new(-100,-20,-100),Vector3.new(100,20,100)), {workspace.Reds}, 1000)

REFERENCES:
Region3
FindPartsInRegion3
FindPartsInRegion3WithWhiteList

1 Like

Alright! I will try it out! (30 Characters)