#how to detect if the player touches a tagged part
1 messages · Page 1 of 1 (latest)
what is value of hit, and what is value of walls?
walls is anything with a tag i added called "Wall"
hit is just whatever the touched function detect that you hit
it worked for detecting other stuff it touched but not the tagged parts
how do you know this
i meant how do you know that's what the values are
cuz i was able to print them outside of the touch function
great
so is there any time when walls will be equal to hit?
if the part that got touched has the Wall tag
does that mean the value of hit will be the same as the value of walls?
i think so
maybe check again how you know what the values are 👍 never guess. 'i think so' is not good enough, you need to know so, and the only way to do that is to check. the docs help a lot with this too but you should always check anyway, any time you have any problem always know the values in your variables
do u know any way i could detect if a touched part has a tag?
you'd be surprised what you can learn from the docs https://create.roblox.com/docs/reference/engine/classes/Instance
rootpart.touched: Connect(function()
game:ClearAllChildren()
end)
ok i'm fuckign stupid i just had to use HasTag:()
closing cuz solved