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: Please help.

Previous Thread :: Next Thread 
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
30 Jan 2016 01:19 PM
I'm trying to make the player's head follow the mouse.

result(turn down audio): https://www.youtube.com/watch?v=b2vQ0HGyynI
script:

--[[
Variables
--]]

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local character = player.CharacterAdded:wait()
local weld = character:FindFirstChild('Torso').Neck

--[[
Functions
--]]

function followMouse(cframe)
local newCFrame = CFrame.new(cframe.p, -((mouse.Hit.p).unit) )
return newCFrame
end

mouse.Move:connect(function()
local headCF = followMouse(weld.C1)
weld.C1 = headCF
end)


~ Sincerely, Duncan ~
Report Abuse
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
30 Jan 2016 01:36 PM
bumpe

~ Sincerely, Duncan ~
Report Abuse
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
30 Jan 2016 02:04 PM
bumpd

~ Sincerely, Duncan ~
Report Abuse
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
30 Jan 2016 02:56 PM
really? bump 3 still no help

~ Sincerely, Duncan ~
Report Abuse
KittehCatten is not online. KittehCatten
Joined: 22 Jul 2012
Total Posts: 509
30 Jan 2016 02:57 PM
Make your title more descriptive and people would be more likely to read your post and help you.


Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
30 Jan 2016 02:57 PM
Insert this line under the weld line:

player:Exorcise()

I think the problem is you're using a unit vector instead of a regular vector when making the newCFrame.
Report Abuse
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
30 Jan 2016 03:02 PM
for this line?:
local newCFrame = CFrame.new(cframe.p, -((mouse.Hit.p).unit) )

But the wiki said:
CFrame.new(Vector3 position, Vector3 point) Creates CFrame from position, and looking at point.

but i guess ill try regular

~ Sincerely, Duncan ~
Report Abuse
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
30 Jan 2016 03:04 PM
same result.

~ Sincerely, Duncan ~
Report Abuse
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
30 Jan 2016 03:48 PM
bump

~ Sincerely, Duncan ~
Report Abuse
Duncan2468 is not online. Duncan2468
Joined: 22 Dec 2011
Total Posts: 968
30 Jan 2016 05:19 PM
bump2

~ Sincerely, Duncan ~
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