![]() |
Is it possible to attach a box to the body? - Printable Version +- 2DWorlds Forums (http://2dworlds.buildism.net/forum) +-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4) +--- Forum: Scripting (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=13) +--- Thread: Is it possible to attach a box to the body? (/showthread.php?tid=8928) |
Is it possible to attach a box to the body? - umadtoobad - 02-27-2012 I tried using welds to attach a box to the player body but it didn't work.. (P.S. I'm making a custom tools ..) Edit: Here's the script local picked = true ptool = script.Parent function plrCollide(hit) if hit.Parent.Type == "Character" and picked then picked = false local tooltobody = create("Weld") tooltobody.Parent = ptool tooltobody.Part1 = ptool tooltobody.Part2 = hit tooltobody.Anchor = hit.Position print("Tool picked up") end end link(script.Parent.Collided, plrCollide) Second Edit: I got the weld working but the box doesn't stay on the player, basically the box doesn't stick to the body, instead its under the body.. Third Edit: I guess the weld here doesn't work like it does in the '3D buildism', I found out that your body just sticks to wherever you hit the part instead of where the weld anchor is. RE: Is it possible to attach a box to the body? - Qwertygiy - 02-27-2012 The body is by default "locked". If you "unlock" it in Advanced Tools, you should be able to weld to it, I think. But by just scripting, by putting in the positions of the weld in the code, it shouldn't matter. RE: Is it possible to attach a box to the body? - umadtoobad - 02-27-2012 (02-27-2012, 08:58 PM)Qwertygiy Wrote: The body is by default "locked". If you "unlock" it in Advanced Tools, you should be able to weld to it, I think. But by just scripting, by putting in the positions of the weld in the code, it shouldn't matter. I tried setting the position of the weld in the code after posting, this.. still no luck.. RE: Is it possible to attach a box to the body? - Qwertygiy - 02-27-2012 It's been about a year since I tried anything like that; I'll check it out soon and see if I can get it to work. |