digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 27 Mar 2013 11:28 AM |
I want to know how to make my 'Left Arm' point where my mouse is going, but whe code I use seems to not point in the right area. I mean, on some axis it does point where the mouse is pointing, but I want the lower part (Using RBX2.0 body, the hand) to point toward my mouse.
I'm currently using this code:
if not char:FindFirstChild("BTDFW") then Instance.new("Weld", char).Name = "BTDFW" char.BTDFW.Part0 = char.Torso char.BTDFW.Part1 = char["Left Arm"] end --Create weld wait() local mousehit = mouse.Hit --index mouse.Hit char.BTDFW.C1 = CFrame.new(Vector3.new(0, 0, 0), mousehit:inverse().lookVector) char.BTDFW.C0 = CFrame.new(Vector3.new(-1, 0, 0)) * CFrame.Angles(0, 0, 0) |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
| |
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 27 Mar 2013 02:32 PM |
Introducing, the 'é' letter!
Lé bump. |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 31 Dec 2013 05:11 PM |
| Hate to resurrect this from the dead but did you ever find the answer? I'm trying to do this too except with a tank turret. |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2013 05:18 PM |
Oh, I tried doing this also, lol. Try this and tell me if it works.
char.BTDFW.C0 = CFrame.new(char["Left Arm"].CFrame.p,char["Left Arm"].CFrame:pointToObjectSpace(mousehit)) |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 31 Dec 2013 05:23 PM |
| It isn't with the character arms. It's with a tank gun, which has two different welds. One for the left/right rotation towards the mouse and the other for the up/down. |
|
|
| Report Abuse |
|
|