|
| 06 Dec 2016 08:25 PM |
instead of mouse.Hit.p?
If I was to make a helicopter face my mouse's direction, I would use mouse.hit.p which is kind of a hack and is kinda glitchy, because if I place my mouse on the helicopter, it would jazz out. Help?
LocalScript:
local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() local moveEvent = workspace.Part.MoveEvent
game:GetService("RunService").RenderStepped:connect(function() moveEvent:FireServer(mouse.Hit.p) end)
--------------------------------------------------------------------------------------------
Script:
local part = workspace.Part local moveEvent = workspace.Part.MoveEvent
function move(target) if script.Parent.Parent:findFirstChild("Engine") and engine and engine:FindFirstChild("BodyGyro") then local mp = engine local dir = (target - mp.Position).unit local pos = mp.Position + (dir*1) mp.BodyGyro.cframe = CFrame.new(pos, pos + dir) mp.BodyGyro.maxTorque = Vector3.new(9000,9000,9000) end end
moveEvent.OnServerEvent:connect(function(plr, hitpos) move(hitpos) end) |
|
|
| Report Abuse |
|
|
| 06 Dec 2016 08:28 PM |
Set the TargetFilter of the mouse to the Helicopter model. This will make the mouse ignore it.
http://wiki.roblox.com/index.php?title=API:Class/Mouse/TargetFilter |
|
|
| Report Abuse |
|
|
| 08 Dec 2016 10:21 PM |
can i undo the target filter with
"mouse.TargetFilter = nil" ? |
|
|
| Report Abuse |
|
vat21s
|
  |
| Joined: 07 Jun 2010 |
| Total Posts: 2508 |
|
| |