How do i check if something isn't touching another thing

im making a trail for a character and i want it to spawn a trail part when you aren’t touching one already, how do i do this?

I understand you want to spawn a trail inside the character, but I dont clearly understand when you want that to happen, could you explain further please? I would like to help you out.

when i use the ability it gives the player a trail, while its active it spawns the trail parts where the player is standing, but i want it so that when you stand in one place the trail parts don’t stack up and after one spawns a new one doesn’t spawn until the player is not touching a trail part (kinda like john doe’s trail in forsaken).

Are you using a trail instance?

If you are you could just detect if a player is on an area with touched, and then disable the trail

i guess that could work, i’ll try it

well this runs into the problem of once it checks if you’re touching a trail part and it disables the trail spawning then how will it reenable it? I still need to know how to make it check when the player ISN’T touching the trail parts, this would make it much easier.

Why not just only spawn trail parts if the humanoid is moving?

local humanoid = Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")

if humanoid.MoveDirection.Magnitude == 0 then
    return --don't spawn right now
end
-- code to spawn

Also, if using a Trail instance, isn’t this just the default behavior?

1 Like

im making my own kind of trail, but checking if the player is moving works

Please do some research next time before making a topic. Your problem has been answered many times.

i tried looking and i couldn’t find anything

Can you describe your problem in more details? Your problem is vague and I’m not sure how the resources I have shared in my previous reply doesn’t seem to solve your problem.

Out of curiosity, what use case does your custom one fit that the builtin instance doesn’t?

Anyhow, if my method works for you, mark it as the solution so people don’t keep trying to recommend their own strategies to deaf ears.