Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 07 Apr 2015 02:28 PM |
So I have some welds in the player's torso, and I want them to change based on the mouse's position (y) while retaining their general position
How would I accomplish this? |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
| |
|
gerov
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 5504 |
|
|
| 07 Apr 2015 02:58 PM |
http://wiki.roblox.com/index.php?title=CFrame
http://wiki.roblox.com/index.php?title=Welds
http://wiki.roblox.com/index.php?title=Lookvector&redirect=no
That is all you need.
|
|
|
| Report Abuse |
|
|
gerov
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 5504 |
|
|
| 07 Apr 2015 02:58 PM |
Wait, not lookvector, sorry, I was thinking of something else.
You need http://wiki.roblox.com/index.php?title=API:Class/Mouse |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 07 Apr 2015 03:11 PM |
>implies I don't know how to use them
|
|
|
| Report Abuse |
|
|
|
| 07 Apr 2015 03:13 PM |
Just think about it And don't overthink it. |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 07 Apr 2015 03:14 PM |
can you guys not
I just want an explanation as to what method should be used |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2015 03:18 PM |
Change the welds as in how?
|
|
|
| Report Abuse |
|
|
gerov
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 5504 |
|
|
| 07 Apr 2015 03:26 PM |
| I haven't had a lot of experience with them, but I know how to do it. But i'd rather you go to the wiki, which has much more information from people with much more experience than me. |
|
|
| Report Abuse |
|
|
MrNicNac
|
  |
| Joined: 29 Aug 2008 |
| Total Posts: 26567 |
|
|
| 07 Apr 2015 03:27 PM |
The general method of adjusting Part1 to stay where it's at, but follow the mouse is:
C1 = (CFrame.new(Part1.Position, Mouse.Hit.p)):toObjectSpace(Part0.CFrame * C0) |
|
|
| Report Abuse |
|
|
|
| 07 Apr 2015 03:31 PM |
P = Game.Players.LocalPlayer M = P:GetMouse() player = game:GetService("Players").LocalPlayer mouse = player:GetMouse() Player = script.Parent.Parent char = player.Character M.KeyDown:connect(function(K) if string.lower(K) == 'e' and M.Target ~= nil then if M.Target.Name == 'Torso' then Part = Instance.new("Part", char.Torso) Part.BrickColor = BrickColor.new("Really black") Part.CanCollide = false -- must add so the weld doesent mess up welding Part.Size = Vector3.new(2,2,2) Part.TopSurface = "Smooth" Part.BottomSurface = "Smooth" w1 = Instance.new("Weld", char.Torso) w1.Name = "Welded Targed" w1.Part0 = M.Target w1.Part1 = Part end end end) |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 07 Apr 2015 05:11 PM |
@Mr
That just makes the arm spazz out when I added it to the mouse's move function |
|
|
| Report Abuse |
|
|
Tripane
|
  |
| Joined: 03 Jun 2011 |
| Total Posts: 11432 |
|
|
| 07 Apr 2015 05:13 PM |
nevermind, I had set part0 incorrectly
but it does exactly what I want it to do, just upside down |
|
|
| Report Abuse |
|
|