ExosXguy
|
  |
| Joined: 10 Oct 2010 |
| Total Posts: 2239 |
|
|
| 08 Dec 2013 12:21 PM |
So, I'm messing with fake tools, in other words making it appear the player has a tool when their backpack is empty. I've done this by welding a handle with a blade to the player's arm as shown below. Weld1 = Instance.new('Weld',script.Parent['Right Arm']) Weld1.Part0 = script.Parent['Right Arm'] Weld1.Part1 = script.Parent.Handle Weld1.C0 = CFrame.new(0,-1,0) Weld2 = Instance.new('Weld',script.Parent.Handle) Weld2.Part0 = script.Parent.Handle Weld2.Part1 = script.Parent.Blade Weld2.C0 = script.Parent.Handle.CFrame:inverse() Weld2.C1 = script.Parent.Blade.CFrame:inverse() script.Parent.Handle.Anchored = false script.Parent.Blade.Anchored = false
This works perfectly fine, the tool welds the the players arm as desired - I'm now trying to figure out how I can force the player's arm into a 90 degree angle, much like when you are holding a tool. I've got this so far:
Weld3 = Instance.new('Weld',script.Parent.HumanoidRootPart) Weld3.Part0 = script.Parent.HumanoidRootPart Weld3.Part1 = script.Parent['Right Arm']
I'm using a weld so it won't interfere with other anims and such, how would I angle this weld so the player's right arm is positioned correctly?
|
|
|
| Report Abuse |
|
|
ExosXguy
|
  |
| Joined: 10 Oct 2010 |
| Total Posts: 2239 |
|
|
| 08 Dec 2013 12:22 PM |
| The tool welds to the player's arm as desired* |
|
|
| Report Abuse |
|
|
ExosXguy
|
  |
| Joined: 10 Oct 2010 |
| Total Posts: 2239 |
|
| |
|
ExosXguy
|
  |
| Joined: 10 Oct 2010 |
| Total Posts: 2239 |
|
| |
|
ExosXguy
|
  |
| Joined: 10 Oct 2010 |
| Total Posts: 2239 |
|
| |
|
ExosXguy
|
  |
| Joined: 10 Oct 2010 |
| Total Posts: 2239 |
|
| |
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 08 Dec 2013 01:56 PM |
| Make the Right Shoulder's Part1 = nil and create a weld with the Right Arm and the Torso with the Right Arm being Point1 and edit the C0 and C1 to match. |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 08 Dec 2013 01:57 PM |
| Dun forget to use CFrame.Angles with the C0 and C1 edited for the 90 degree angle. |
|
|
| Report Abuse |
|
|
ExosXguy
|
  |
| Joined: 10 Oct 2010 |
| Total Posts: 2239 |
|
|
| 08 Dec 2013 02:03 PM |
| What do you mean by 'making c0 and c1 match' ? |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 08 Dec 2013 02:05 PM |
*to match
I mean you edit those (just C0 works, real tools use C0 and C1 for some odd reason) to what fits you fancy.
I'm guessing this is the C0 you want: CFrame.new(1.5,0.5,0)*CFrame.Angles(0,math.rad(90),0)
Or something close to that. |
|
|
| Report Abuse |
|
|
ExosXguy
|
  |
| Joined: 10 Oct 2010 |
| Total Posts: 2239 |
|
|
| 08 Dec 2013 02:09 PM |
Weld3 = Instance.new('Weld',script.Parent.HumanoidRootPart) Weld3.Part0 = script.Parent.HumanoidRootPart Weld3.Part1 = script.Parent['Right Arm'] Weld3.C0 = CFrame.new(1.5,0.5,0)*CFrame.Angles(0,math.rad(90),0)
This does weld my arm, but turns the arm into my body so the sword's impaling my waist rather than give me the same arm position as a tool. |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 08 Dec 2013 02:10 PM |
| I prolly did the rotation in the wrong direction... unless you mean it's the position of the arm. |
|
|
| Report Abuse |
|
|
ExosXguy
|
  |
| Joined: 10 Oct 2010 |
| Total Posts: 2239 |
|
|
| 08 Dec 2013 02:12 PM |
| My arm's slightly higher up than my torso, and rotated inwards so any tool held is pointing into my torso. |
|
|
| Report Abuse |
|
|
ExosXguy
|
  |
| Joined: 10 Oct 2010 |
| Total Posts: 2239 |
|
|
| 08 Dec 2013 03:34 PM |
| Well on the bright side, fixed that. Now I've made a basic arm up/down anim - it 'works' but doesn't rotate on the point I'd want it to - is there a way to rotate it by the end ('shoulder') than the centre? Looks a bit odd. |
|
|
| Report Abuse |
|
|