|
| 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 |
|
|
|
| 30 Jan 2016 01:36 PM |
bumpe
~ Sincerely, Duncan ~ |
|
|
| Report Abuse |
|
|
|
| 30 Jan 2016 02:04 PM |
bumpd
~ Sincerely, Duncan ~ |
|
|
| Report Abuse |
|
|
|
| 30 Jan 2016 02:56 PM |
really? bump 3 still no help
~ Sincerely, Duncan ~ |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 30 Jan 2016 03:04 PM |
same result.
~ Sincerely, Duncan ~ |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Jan 2016 05:19 PM |
bump2
~ Sincerely, Duncan ~ |
|
|
| Report Abuse |
|
|