Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
|
| 12 Jul 2016 05:41 PM |
I'm trying to get 3 parts to follow the player's mouse vertically when in first person. To do this, I weld the parts to the head. I'm not sure where I go from here, do I rotate the welds C1? If so, to what?
|
|
|
| Report Abuse |
|
|
|
| 12 Jul 2016 05:46 PM |
weld the parts to another part that is welded to the head
that way you only have to change the weld of the part that is connected head
and only vertically
you can do some trig for the math |
|
|
| Report Abuse |
|
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
|
| 12 Jul 2016 05:48 PM |
I have other welds attached to the parts I want to move, welded to the torso, and I'm using these welds to animate a gun with reloading and such
If I do what you suggested, that won't interfere with those animations, right? Like if they look up they can still reload properly?
|
|
|
| Report Abuse |
|
|
nox7
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 27467 |
|
|
| 12 Jul 2016 06:04 PM |
Here's what I would set the C1 of the Neck joint to, in a loop:
local origin = Torso.Position + Vector3.new(0,1.5,0) local lookAt = Mouse.Hit.p local objSpaceVector = CFrame.new( origin, Vector3.new(origin.X, lookAt.Y, origin.Z) ):toObjectSpace(Torso.CFrame * Neck.C0) Neck.C1 = CFrame.new(0,-.5,0) * (objSpaceVector - objSpaceVector.p)
That will make the head follow the mouse vertically. |
|
|
| Report Abuse |
|
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
|
| 12 Jul 2016 06:09 PM |
so would the head moving not kill the player? I assumed it would and would moving the head then move the arms if I welded them to the head?
|
|
|
| Report Abuse |
|
|
|
| 12 Jul 2016 06:10 PM |
| no if you move the Neck joint the player will stay alive |
|
|
| Report Abuse |
|
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
|
| 12 Jul 2016 06:12 PM |
how do i move the neck joint? i've never used joints before
|
|
|
| Report Abuse |
|
|
|
| 12 Jul 2016 06:13 PM |
torso.Neck.C0 =
torso.Neck.C1 = |
|
|
| Report Abuse |
|
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
|
| 12 Jul 2016 06:32 PM |
so it's just a weld? thanks
|
|
|
| Report Abuse |
|
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
|
| 12 Jul 2016 08:19 PM |
@nox that didn't work for me
|
|
|
| Report Abuse |
|
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|