|
| 14 Mar 2017 07:33 PM |
I have a model plane anchored in the sky and I'm trying to make it point to mouse.hit, here's my script
plane = game.Workspace.PlaneModel.Engine
mouseMove = script.Parent.Parent.Parent:GetMouse()
function planeRot() game.Workspace:waitForChild("PlaneModel") mousePos = mouseMove.Hit.p plane.CFrame = CFrame.new(plane.CFrame, mousePos) end mouseMove.Move:connect(planeRot)
The script is inside of tool, hence the parents |
|
|
| Report Abuse |
|
|
KapKing47
|
  |
| Joined: 09 Sep 2012 |
| Total Posts: 5522 |
|
| |
|
|
| 14 Mar 2017 07:47 PM |
| Oh sorry, Players.Player1.Backpack.Plane.Script:35: bad argument #1 to 'new' (Vector3 expected, got CFrame) |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2017 07:54 PM |
| Not sure why (Vector3 expected, got CFrame) because when I put in vector3 instead of CFrame it then says (CFrame expected, got Vector3) |
|
|
| Report Abuse |
|
|
| |
|
|
| 14 Mar 2017 08:14 PM |
when making a cframe from a position looking at another position both arguments have to be a vector3
in your script the first argument is a cframe
replace the first argument with "plane.CFrame.p" |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2017 08:19 PM |
So, instead of function planeRot() game.Workspace:waitForChild("PlaneModel") mousePos = mouseMove.Hit.p plane.CFrame = CFrame.new(plane.CFrame, mousePos) end it would be... function planeRot() game.Workspace:waitForChild("PlaneModel") mousePos = mouseMove.Hit.p plane.CFrame.p = CFrame.new(plane.CFrame, mousePos) end
?? If so it didn't work |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 Mar 2017 08:27 PM |
as in plane.CFrame = CFrame.new(plane.CFrame.p, mousePos) |
|
|
| Report Abuse |
|
|
|
| 14 Mar 2017 08:37 PM |
| Okay cool that worked, thanks |
|
|
| Report Abuse |
|
|