White Screen Bug - Mouse Error

All I know is your screen goes white, or flashes white. This happens when you have a bodygyro attached to your character (directly or indirectly). Basically your screen goes white.

Here’s the thing: It happens when you TYPE. So far, two of my games are affected by this. People hate it. I showed a ROBLOX engineer and they had no idea. In both cases, the bodygyro is being aimed at your mouse. Perhaps when you type the mouse isn’t received properly, therefore the bodygyro freaks out?

This is why you attach “if mouse.Target” to every mouse event.

I believe if you set the direction of a gyro to a vector (0,0,0) it freaks out and flings it into infinity.

No? I don’t care if there’s a target. I care if there is a Hit. I get a direction off of that.

When typing it appears that the mouse.Hit is not assigned properly (possibly set to 0,0,0)

Yes yes yes this happened to me to. I found a solution though.

So I went like
Gyro.cframe=CFrame.new(Torso.CFrame.p,Direction)
and it somehow worked even though Gyro doesn’t mess with the actual position n stuff.

[quote] Yes yes yes this happened to me to. I found a solution though.

So I went like
Gyro.cframe=CFrame.new(Torso.CFrame.p,Direction)
and it somehow worked even though Gyro doesn’t mess with the actual position n stuff. [/quote]

Wait, explain?

I aim a bodygyro at mouse.Hit, how is that a solution? Didn’t quite understand :confused:

[quote] Yes yes yes this happened to me to. I found a solution though.

So I went like
Gyro.cframe=CFrame.new(Torso.CFrame.p,Direction)
and it somehow worked even though Gyro doesn’t mess with the actual position n stuff. [/quote]

Wait, explain?

I aim a bodygyro at mouse.Hit, how is that a solution? Didn’t quite understand :/[/quote]

I meant position instead of direction.
What I was trying to say was for some reason the gyro cframe has to incorporate your torso’s CFrame along with the Hit coordinates. This is what I used in one of my games

local Gyro=Instance.new("BodyGyro",Character.Torso)
Gyro.maxTorque=Vector3.new(math.huge,math.huge,math.huge)
mouse.Move:connect(function()
Gyro.cframe=CFrame.new(Character.Torso.CFrame.p,Vector3.new(mouse.Hit.X,Character.Torso.CFrame.Y,mouse.Hit.Z))
end)

My game doesn’t use the torso. It’s a …let’s call it a plane…that has the gyro in it.

This might solve some cases of the problem.

If ~(direction:isClose(Vector3.new(0,0,0), .01)) then -- do task end

direction is a vector

However, for me this doesn’t solve all cases of the gyro deciding to flip out :/.

[quote] This might solve some cases of the problem.

If ~(direction:isClose(Vector3.new(0,0,0), .01)) then -- do task end

direction is a vector

However, for me this doesn’t solve all cases of the gyro deciding to flip out :/. [/quote]

I changed my code

Instead of

BodyGyro.cframe = mouse.Hit

I used

BodyGyro.cframe = CFrame.new(seat.Position, mouse.Hit.p)

If you start typing, you don’t flip out HOWEVER the seat does rotate 180 degrees to face the camera for some reason. Definitely a bug.

[quote]

I changed my code

Instead of

BodyGyro.cframe = mouse.Hit

I used

BodyGyro.cframe = CFrame.new(seat.Position, mouse.Hit.p)

If you start typing, you don’t flip out HOWEVER the seat does rotate 180 degrees to face the camera for some reason. Definitely a bug. [/quote]

You sure its facing the Camera? it could be facing the origin of the place, Point (0,0,0).

If it is in fact facing the camera then it would seem that when typing, mouse.hit becomes the CFrame of the Camera :?

Why I ask this is with the previous method you were using it shouldn’t flip out if mouse.hit was set to the camera’s CFrame when you type, only Vector(0,0,0) I would think would cause it to bug out.

Definitely Bug IMO.