generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: CFrame Help

Previous Thread :: Next Thread 
xXfurheadXx is not online. xXfurheadXx
Joined: 22 Oct 2012
Total Posts: 409
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 is not online. KapKing47
Joined: 09 Sep 2012
Total Posts: 5522
14 Mar 2017 07:44 PM
What isn't working?


Report Abuse
xXfurheadXx is not online. xXfurheadXx
Joined: 22 Oct 2012
Total Posts: 409
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
xXfurheadXx is not online. xXfurheadXx
Joined: 22 Oct 2012
Total Posts: 409
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
xXfurheadXx is not online. xXfurheadXx
Joined: 22 Oct 2012
Total Posts: 409
14 Mar 2017 08:02 PM
Bump
Report Abuse
jumpykilldestroy is online. jumpykilldestroy
Joined: 15 Jul 2012
Total Posts: 12319
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
xXfurheadXx is not online. xXfurheadXx
Joined: 22 Oct 2012
Total Posts: 409
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 is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Mar 2017 08:27 PM
plane.CFrame.p
Report Abuse
cntkillme is not online. 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
xXfurheadXx is not online. xXfurheadXx
Joined: 22 Oct 2012
Total Posts: 409
14 Mar 2017 08:37 PM
Okay cool that worked, thanks
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image