I want to make a feature where if you're colliding with a part (in this case a tornado), your character has a blur effect. Is there anyway to do this with a Touched function in a local script?
I suppose that you should be able to insert a block inside the tornado, turn CanCollide Off, and the use the Touched Event on the block. However i am pretty new to roblox, but thats the way i would try to solve this problem.
if you wanted to make the player "blurry", you would use a script, not a local script: a local script is only client-sided, which means the blur effect would apply to only your side of the game, instead of the server. To make a blur effect, I would make each child of the character that is a part transparent. Script for the tornado:
1 | Tornado.Touched:Connect( function (part) |
2 | if game.Playerst:GetPlayerFromCharacter(part.Parent) then --if player recognized from part touched |
3 | for _,v in pairs (part.Parent:GetChildren) do --fetches all children of player |
4 | if v:IsA( "Part" ) then --makes sure "v" is a part before making it transparent |
5 | v.Transparency = 0.5 --or whatever you'd like |
6 | end |
7 | end |
8 | end |
this should work :)