generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Weld in torso target mouse?

Previous Thread :: Next Thread 
Tripane is not online. 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 is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
07 Apr 2015 02:48 PM
bump
Report Abuse
gerov is not online. 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 is not online. 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 is not online. 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
IndieDeveloper is not online. IndieDeveloper
Joined: 24 Mar 2015
Total Posts: 32
07 Apr 2015 03:13 PM
Just think about it
And don't overthink it.
Report Abuse
Tripane is not online. 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
IndieDeveloper is not online. IndieDeveloper
Joined: 24 Mar 2015
Total Posts: 32
07 Apr 2015 03:18 PM
Change the welds as in how?
Report Abuse
gerov is not online. 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 is not online. 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
deadly3652 is not online. deadly3652
Joined: 17 Nov 2011
Total Posts: 268
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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image