Mouse.Hit rotation matrix NAN when chatting

Subject says it all pretty much. When a user is chatting in-game (from the time they press ‘/’ till they press ‘enter’), the rotation matrix of the player’s mouse.Hit property becomes NAN.

I discovered this when having issues with people flying my planes. When they would chat, they would get a ‘white screen’ issue, which was caused because the mouse.Hit property was being used to set the BodyGyro of the plane to the direction of the mouse. With the rotation matrix being NAN, it just goes crazy and breaks.

X, Y, and Z properties of the CFrame value remain fine.

I am currently checking for NAN in the rotation by doing the following:

local NAN = tostring(0 / 0)
function IsRotationNAN(cframe)
   local n = select(4, cframe:components())
   return (tostring(n) == NAN)
end

Yea this is really irritating I have a demo for this that shows other issues with the mouse property when entering the chat.

didn’t mean to thank, oh well.

afaik, NaN is not equal to itself, and I faintly remember using this to detect it:

if not (num < num) then
--it is in fact a number

I have identified the problem and have a fix that should go out in about a week.

Awesome, thank you!

Did this issue also apply to typing in textboxes?

I’m glad that this is going to be fixed. In the meantime, a handy way to make sure numbers aren’t messed up is comparing it to itself, because 0/0==0/0 returns false

This should be fixed now on mac + PC (maybe Android too, iOS in the next few days).

Very cool. Thank you!

NUUUUUUUUUUUUUUU, that glitch was so helpful in other cases!! For instance, it made it so you could continue walking as you typed! I’m sad now.

I had this issue to. It also affected the Mouse unit ray, and the X and Y coordinates of the location. I conveniently abused this feature to check to see when a player is typing. My way of checking was seeing if the magnitude of the mouse unit ray was 0.

Also, this “bug” as it so is called, only applied to certain computers and whatnot, as it did not reproduce on my laptop.

To answer litozinnamon’s question, yes, it did.

I believe they are talking about other glitch. But if they removed that functionality while fixing this glitch, then damn, that’s not fun…

"But if they removed that functionality while fixing this glitch, then damn, that’s not fun… "

It’s not exactly a loss of functionality. If your game relied on it then it was already broken because the “functionality” brought by the bug, as Quenty said, was not actually reliable, it didn’t even work on all machines / platforms.