Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
|
| 24 Jun 2016 05:20 PM |
In the following script, I weld the player's arms to the torso, then rotate shoulder joints to make their arms follow the camera. How can I instead weld them to the head and use the neck joint for the same effect?
local player = game:GetService("Players").LocalPlayer local mouse = player:GetMouse() local character = player.Character or player.CharacterAdded:wait() local torso = character:WaitForChild("Torso") local arm1 = character:WaitForChild("Left Arm") local arm2 = character:WaitForChild("Right Arm") local lShoulder = torso:WaitForChild("Left Shoulder") local rShoulder = torso:WaitForChild("Right Shoulder")
weld1 = Instance.new("Weld", torso) weld1.C0 = CFrame.new(-1.5,.5,0) weld1.Part1 = arm1
weld2 = Instance.new("Weld", torso) weld2.C0 = CFrame.new(1.5,.5,0) weld2.Part1 = arm2
local offset = CFrame.new(0,0,-0.5)*CFrame.Angles(math.pi/2,0,0) local yz = Vector3.new(0,1,1) local function FPS_Arms() arm1.LocalTransparencyModifier = 0 arm2.LocalTransparencyModifier = 0 local tCFrame, hit = torso:GetRenderCFrame(), mouse.Hit.p local p0c0 = tCFrame*weld1.C0 weld1.C1 = (CFrame.new(p0c0.p, p0c0*(p0c0:inverse()*hit*yz))*offset):inverse()*p0c0 local p0c0 = tCFrame*weld2.C0 weld2.C1 = (CFrame.new(p0c0.p, p0c0*(p0c0:inverse()*hit*yz))*offset):inverse()*p0c0 end
local function CameraModeChanged(prop) if prop ~= "CameraMode" then return end if player.CameraMode == Enum.CameraMode.LockFirstPerson then game:GetService("RunService"):BindToRenderStep("FPS_Arms", Enum.RenderPriority.First.Value, FPS_Arms) lShoulder.Part0 = nil rShoulder.Part0 = nil weld1.Part0 = torso weld2.Part0 = torso else game:GetService("RunService"):UnbindFromRenderStep("FPS_Arms") lShoulder.Part0 = torso rShoulder.Part0 = torso weld1.Part0 = nil weld2.Part0 = nil end end
player.Changed:connect(CameraModeChanged) CameraModeChanged("CameraMode")
|
|
|
| Report Abuse |
|
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|
|
| 26 Jun 2016 01:24 AM |
HELLO YOU'RE SCIRPT YOUR LOOK FOR IS NOT THIS!!!!!!!! WRONG ONE.. DO THIS
WELD(ARMS TO HEAD) WHILE NOT FALSE DO WHILE TRUE DO WAIT(ROTATE NECK) END END
#code R+ | local RAP = "R$726,102"; local robux = "R$11,041"; |
|
|
| Report Abuse |
|
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|
|
| 27 Jun 2016 01:33 AM |
| when your too good for almost everyone on this forum |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 27 Jun 2016 02:37 AM |
I always just weld things to the torso..
Last time I tried welding the head some funky stuff happened. |
|
|
| Report Abuse |
|
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
|
| 27 Jun 2016 02:51 AM |
I can't weld to the torso, because I need this animation to occur in unison with ROBLOX animations which use torso welds
|
|
|
| Report Abuse |
|
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|
Widths
|
  |
| Joined: 12 Aug 2014 |
| Total Posts: 41286 |
|
| |
|