Mouse location part rotation is bugged

i will give acces to you for game please wait some seconds

2 Likes

I unfortunately can’t help you directly, I don’t have a pc with me at the moment

2 Likes






2 Likes

okay, at KeyHandler change the localplayer line for this:

local mouse = game.Players:GetPlayerFromCharacter(script.Parent.Occupant.Parent):GetMouse()

then see if it works

3 Likes

To go along with the suggestions the others have had about your script, it may be something called gimbal lock.
This happens when you rotate a CFrame by 90 degrees causing 2 of the axes to align and flip your values.
Type in ‘gimbal lock’ using the Search bar up top and you’ll see a few posts and solutions about this issue.

2 Likes

just saying, the cframe was wrong at first because it was directed at a vector3 he made from using a vector2, which was storing the mouse position on the screen, not in the world, which you can take notice of by seeing how the vehicle only seemed to want to point at the spawnpoint, which I believe is the origin (0,0,0)

2 Likes

Yes, but my addition refers to an issue they may get when the world position issue gets fixed. I’ve seen the issue posted about here many times so I was trying to get them more information that may help if it happens.

2 Likes

You are incorrectly using RemoteEvents and Vector3s.

Change

to
script.Parent.MouseLocation.OnServerEvent:Connect(function(player, mousePosition)

and change

to
script.Parent.Parent.Base.CFrame = CFrame.new(script.Parent.Parent.Base.Position, mousePosition)

2 Likes

I think the issue might be that the local script is inside the vehicle model, meaning the mouse can’t be found