How to Stop a Warning From Printing?

So in my game, I am using the new BasePart.CanTouch property for a hitbox, but every time I set BasePart.CanTouch to false, it gives me this warning in the output:

I want to disable this warning from being printed:

image

The reason I want to disable it is because I already know that the TouchTransmitter will be removed and therefore don’t need to see this warning, and more importantly, since it prints a massive amount of times, the flooding in the output causes the game to lag.

I have tried doing things like these to try to stop the warning from printing:

  1. Destroying all the TouchTransmitters before setting CanTouch to false

  2. Putting in a pcall to see if the warning stops

Neither work…

If someone could possibly tell me how to stop this warning from printing that would be much appreciated!

4 Likes

TouchTransmitter will only appear if you’re using an event (or internal code) that requires hit events; ie: Touched, TouchEnded, Handle under Tools

3 Likes

Yes you are correct, I use the .Touched event of the BasePart which creates it, but the problem I am having is I want to disable the warning from printing when I set .CanTouch to false.

3 Likes

Touched wont fire if CanTouch is false, since Roblox wont run any collision detection for the part.

CanCollide was different since the part would still do a collision check.

3 Likes

That is also true, and why I use the CanTouch property, but do you know how to disable the warning from printing in the output?

3 Likes

Hello Moonvane!

It is likely that it is re-creating the TouchTransmitter because you still have an active .Touched event somewhere. Try disconnecting that and then setting CanTouch to false.

Hope this helps!

1 Like

I really appreciate the thinking man! Although I tried disconnecting the event before I set CanTouch to false exactly as you said but unfortunately it is still printing it :thinking:

1 Like

Does anyone have any ideas on how to fix this?

1 Like

I am having the same issue: this unnecessary warning flooding the console.

All I am doing is setting:
object.CanTouch = false
shortly before the object is destroyed.

I know very well the “TouchTransmitter will be removed” since that is exactly what I expect to happen by disabling it, so it does not do anymore touch events.

Why is there a warning for this expected behavior?
Please remove.

I personally have not tried destroying also the TouchTransmitter at the same time, but as @Moonvane writes, that does not solve it either.

Any other idea?

1 Like

I have great news :sunglasses: i fixed it

So basically I am on my phone rn so I am only 95% sure about this, but what fixed it for me is removing the touch transmitter right before I change CanTouch to false, and even though it didn’t fix it before like in the OP, it did this time

1 Like

The warning appears in the Server output. Client output won’t have this message pop up. You are probably getting this still because you are in studio. You shouldn’t really worry about it unless you even want your Server output to be as clean as the Client’s.

1 Like

No actually when your in studio, the output displays both server and client output simultaneously, and the warning stopped printing on both. :100:

1 Like

It didn’t work when I tried it.
but I realized later, it’s not called TouchTransmitter, it’s TouchInterest

and can you tell the solution is found. I think you understand what I mean

1 Like