I’m currently making a car which you operate in first person with interactive buttons and all that. The problem I am having is that I cannot figure out for the life of me how to turn using a steering wheel and your mouse.
I really need help with figuring out how to rotate a steering wheel with my mouse. Thank you for any ideas!
Please tell me if this is breaking any rules or has been posted somewhere else
If your wanting to detect if the player is moving their mouse left or right, and steer it, you can use this in a LocalScript inside of a gui or playerscripts:
local m = game.Players:GetMouse()
local position = {m.X, m.Y}
m.Move:connect(function()
if m.X <= position[1] + 2 then
//put the steering script here
end
if m.X >= position[1] - 2 then
//put the steering script here
end
end)
This does work but I have to be in first person to interact with buttons in the car, so the mouse X stays the same since the mouse is locked in the middle of the screen. ( See pic below )
( Note that the “Left” and “Right” buttons are just a replacement to turn for now. )
Thank you so much anyways!
This can be done by attaching the steering wheel to the car with either a HingeConstraint, Hinge, or anything that can let it spin freely. Afterwards, proceed to do the dragging part, which a tutorial simillar to your situation can be found here.