transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 16 Mar 2014 10:34 PM |
| do I have to use :GetMouse() to make my head's cframe my cursor's position? |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
| |
|
trogyssy
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 2322 |
|
|
| 16 Mar 2014 10:40 PM |
If your head disconnects from the torso you die.
~~trogyssy, Scripting Helper and S&I Activist~~ |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 16 Mar 2014 10:40 PM |
.........
>position of cursor that is not disconnecting/repositioning your head
|
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 16 Mar 2014 10:41 PM |
there's a lot more that goes into this than just :GetMouse()... -=Robo=- |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 16 Mar 2014 10:43 PM |
okay if I mighth have said it wrong but
what I want to do is
when I move my cursor on the screen, my head's face will face that position using cframe |
|
|
| Report Abuse |
|
|
trogyssy
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 2322 |
|
|
| 16 Mar 2014 10:45 PM |
You mean rotation then. Be more specific next time, sheesh.
~~trogyssy, Scripting Helper and S&I Activist~~ |
|
|
| Report Abuse |
|
|
|
| 16 Mar 2014 10:46 PM |
.CFrame for rotation..otherwise it falls apart yeesh |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 16 Mar 2014 11:11 PM |
loll
do any of you know how to do that? |
|
|
| Report Abuse |
|
|
trogyssy
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 2322 |
|
|
| 16 Mar 2014 11:15 PM |
I'll go do some research, then put it in a game and not give it to you.
~~trogyssy, Scripting Helper and S&I Activist~~ |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 16 Mar 2014 11:37 PM |
then what is that point of telling me you are going to do it and not give me the slightest hint of how to loop my head's cframed position of my cursor
common sense, man |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 16 Mar 2014 11:38 PM |
| your siggy says otherwise, silly you |
|
|
| Report Abuse |
|
|
trogyssy
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 2322 |
|
|
| 17 Mar 2014 12:01 AM |
I don't enjoy being mocked.
~~trogyssy, Scripting Helper and S&I Activist~~ |
|
|
| Report Abuse |
|
|
Cawlonee
|
  |
| Joined: 03 Mar 2014 |
| Total Posts: 2687 |
|
|
| 17 Mar 2014 03:56 AM |
| What you've just said is one of the most insanely idiotic things I have ever heard. At no point in your rambling, incoherent response were you even close to anything that could be considered a rational thought. Everyone in this room is now dumber for having listened to it. I award you no points, and may --ew-- have mercy on your soul. |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2014 07:33 AM |
@Cawlonee Heh, wasn't that from some movie where an adult goes to first grade or something?
@transiate mouse.Move:connect(function() --Adjust neck every time mouse is moved neck.C0 = CFrame.new(0,1,0) --Makes it so the head is rotated from the base of the head instead of the middle of it local headCF = torso.CFrame*CFrame.new(0,0.5,0) --The "normal" CFrame for the head (accounting for C0 also) local newCF = CFrame.new(headCF.p,mouse.Hit.p) --The desired CFrame for the head neck.C1 = newCF:inverse()*torso.CFrame --Use some CFrame math to make the weld be in the correct location. end) |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 17 Mar 2014 10:03 AM |
| wow i never knew these mouse events thanks robust |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 17 Mar 2014 10:09 AM |
| that does not work, >attempt to index global 'mouse' |
|
|
| Report Abuse |
|
|
trogyssy
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 2322 |
|
|
| 17 Mar 2014 10:12 AM |
Is it in a localscript?
~~trogyssy, Scripting Helper and S&I Activist~~ |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
| |
|
|
| 17 Mar 2014 10:13 AM |
--Ah, I assumed you were going to be adding in all the variables yourself xD --Assuming this is a localscript
wait(1) local player = game.Players.LocalPlayer local mouse = player:GetMouse() local char = player.Character local head = char.Head local torso = char.Torso local neck = torso.Neck
mouse.Move:connect(function() --Adjust neck every time mouse is moved neck.C0 = CFrame.new(0,1,0) --Makes it so the head is rotated from the base of the head instead of the middle of it local headCF = torso.CFrame*CFrame.new(0,0.5,0) --The "normal" CFrame for the head (accounting for C0 also) local newCF = CFrame.new(headCF.p,mouse.Hit.p) --The desired CFrame for the head neck.C1 = newCF:inverse()*torso.CFrame --Use some CFrame math to make the weld be in the correct location. end) |
|
|
| Report Abuse |
|
|
transIate
|
  |
| Joined: 20 Jun 2013 |
| Total Posts: 2699 |
|
|
| 17 Mar 2014 10:14 AM |
this rturns no errors;
plr=game:service'Players'.localPlayer; mouse=plr:getMouse'' mouse.Move:connect(function() neck.C0 = CFrame.new(0,1,0) local headCF = torso.CFrame*CFrame.new(0,0.5,0) local newCF = CFrame.new(headCF.p,mouse.Hit.p) neck.C1 = newCF:inverse()*torso.CFrame end) ------------ but nothing happens |
|
|
| Report Abuse |
|
|
trogyssy
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 2322 |
|
|
| 17 Mar 2014 10:14 AM |
Add this as the first line:
local mouse=Game.Players.LocalPlayer.PlayerMouse
~~trogyssy, Scripting Helper and S&I Activist~~ |
|
|
| Report Abuse |
|
|
LemmJuice
|
  |
| Joined: 23 Feb 2014 |
| Total Posts: 866 |
|
|
| 17 Mar 2014 10:16 AM |
You need to define the variable, aldo makeit a localscript: mouse = game.Players.localplayer:GetMouse() |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2014 10:17 AM |
| Copy-Paste robusts exact script,it should work |
|
|
| Report Abuse |
|
|
|
| 17 Mar 2014 10:20 AM |
Also,add this line right after mouse = plr:GetMouse() And char = plr.Character
--mouse line is here repeat wait() until plr.Character--so char won't be nil --char line is here |
|
|
| Report Abuse |
|
|