I have a lot of parts with touches. part.Touched:Connect(onTouch)
Work part.Touched loads the system when the part is in the workspace, will touch work if the part is not in the workspace? That is, I want to remove a part from the workspace when it is not needed and return it back when it is needed.
#Scripting-Support, is the appropriate category for your post, I suppose. Also no it will not.
Yeah that’s what i mean’t by #Scripting-Support, if I had pressed enter it would have auto corrected, but i forgot lol
No.
Chances are there’s a better way of doing what you are looking to do, instead of .Touched.
If part is not in Workspace, can’t get touched.
Yes it’s gonna work when you put it back again into workspace as you said. It just wont work when it’s not in the workspace.
This is not the point, Inside each touch there is a cycle that checks for touch, the question is will this cycle work?
It will only work once the part is in workspace. If you move it to anything else it will not work until you put it back in workspace again.
i.e. when a part is not in the workspace, touches are not checked?
True. When the part is not in workspace the part won’t be shown in the players screen at any point. So there is no way that the touch would work when not in workspace.
The part needs to be in workspace in order to get touched.
Please mark this as a solution if it solves your problem.
It will work for this:
That is, I want to remove a part from the workspace when it is not needed and return it back when it is needed.
Just put it in ServerStorage when it’s un-needed, and when it is needed, return it to workspace.
Just try Workspace.StreamingEnabled if it is only for the Performance. Touched Events are (my knowledge) only working in the Workspace.
It’s a long process for my game, I’m just set parent = nil
It goes without saying that you can’t touch a piece if it’s not in the workspace. The question is whether the internal touch check algorithm will work?
The answer has already been spammed by other developers here. And the simple answer is that the .Touched
event will not work if it’s not in workspace. That’s it.