seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 29 Dec 2013 04:22 PM |
function move(m) moving = true while (moving) do local position = m.Hit local target = position.p local origincframe = weld.C0 local dir = (target - connector.Position).unit local spawnPos = connector.Position
local poss = spawnPos + (dir * 1)
weld.C0 = CFrame.new(poss, poss + dir) wait(0.1) weld.C0 = origincframe end end
I tried adapting a BodyGyro script that follows a mouse, to make it change welds instead to follow the mouse. Anyone know why it doesn't work? There's no output.. |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 29 Dec 2013 04:40 PM |
Bump. I just want to know how to make a brick face towards where the mouse is pointing using a Weld. |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
| |
|
|
| 29 Dec 2013 05:15 PM |
| Have you called the function? |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 29 Dec 2013 05:16 PM |
Yes. Everything in the script works except this part. I can't seem to make a brick weld it's lookvector towards where the mouse it pointing.. |
|
|
| Report Abuse |
|
|
|
| 29 Dec 2013 05:20 PM |
| Add some print()s to it, see what line it stops at. |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 29 Dec 2013 05:27 PM |
I realized what I did wrong. Anyways now I got this function to trigger, however there's an error for line 79 which is this part : weld.C0 = CFrame.new(weld.C0, poss + dir)
The error is : Driver:79: bad argument #1 to 'new' (Vector3 expected, got userdata) |
|
|
| Report Abuse |
|
|
|
| 29 Dec 2013 05:30 PM |
| The frame needs to bits. Eg CFrame.new(0,0,0), but your doing something like (0,0) |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
|
| 29 Dec 2013 05:33 PM |
function move(m) moving = true while (moving) do local position = m.Hit local target = position.p local origincframe = weld.C0 local dir = (target - connector.Position).unit print("target aquired") local spawnPos = connector.Position
local poss = spawnPos + (dir * 1)
weld.C0 = CFrame.new(poss, poss + dir) print("weld change") wait(0.1) weld.C0 = origincframe end end
Okay I did this and it ALMOST worked. One major issue though..the gun welds to a different location, I just want it to rotate in the direction of the mouse. |
|
|
| Report Abuse |
|
|
seanb117
|
  |
| Joined: 03 Feb 2010 |
| Total Posts: 1020 |
|
| |
|