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 » Scripting Helpers
Home Search
 

Re: Making arms move up and down with the mouse

Previous Thread :: Next Thread 
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 10:54 AM
I tried using this:

CFrame.new(Vector3.new(CFrame.x,CFrame.y,CFrame.z),Vector3.new(mouse.Hit.X,Mouse.Hit.Y,Mouse.Hit.Z))

But the arms just ended up killing the character, any ideas?
Report Abuse
PsudeoPlayer is not online. PsudeoPlayer
Joined: 19 Jul 2013
Total Posts: 306
15 Aug 2013 11:01 AM
Not sure if this'll work, but try this:

CFrame.new(arm.CFrame.p, mouse.Hit.p)*CFrame.Angles(0, 0, math.rad(90))

Replace 'arm' with a reference to the arm.
Obviously one for left and one for right, too.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 11:56 AM
Um, ok, I think I'll try connecting that to the Mouse.Move event.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 12:02 PM
12:02:28.994 - maximum event re-entrancy depth exceeded

mouse.Move:connect(function()
rs.C0 = CFrame.new(arm.CFrame.p, mouse.Hit.p)*CFrame.Angles(0, 0, math.rad(105))
ls.C0 = CFrame.new(arm.CFrame.p, mouse.Hit.p)*CFrame.Angles(0, 0, math.rad(-100))
end)
end)
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 12:08 PM
Tried doing this but it still doesn't work

mousemove = false

mouse.Move:connect(function()
if mousemove == false then
mousemove = true
rs.C0 = CFrame.new(arm.CFrame.p, mouse.Hit.p)*CFrame.Angles(0, 0, math.rad(105))
ls.C0 = CFrame.new(arm.CFrame.p, mouse.Hit.p)*CFrame.Angles(0, 0, math.rad(-100))
mousemove = false
end
end)
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 12:27 PM
maybe add a wait() at beginning of Move Event?
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 12:31 PM
Nope, didn't work, stumped.
Report Abuse
orlorx2222 is not online. orlorx2222
Joined: 21 Jul 2011
Total Posts: 8537
15 Aug 2013 12:35 PM
you're an oter right
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 12:37 PM
um yes sort of why
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 01:27 PM
Still not working, btw I have rs and ls defined as Right Shoulder and Left Shoulder Motor6D's.

mouse.Move:connect(function()
if mousemove == false then
mousemove = true
wait(0.025)
rs.C0 = CFrame.new(rs.C0.p, mouse.Hit.p)*CFrame.Angles(0, 0, math.rad(105))
ls.C0 = CFrame.new(ls.C0.p, mouse.Hit.p)*CFrame.Angles(0, 0, math.rad(-100))
mousemove = false
end
end)
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 02:03 PM
Any ideas about that error I got?
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
15 Aug 2013 02:36 PM
function lajoijigpoiqhgkngkngoigniwgn(mouse) -- If it's in a hopperbin...
mouse.Move:connect(function()
if mousemove == false then
mousemove = true
wait(0.025)
rs.C0 = CFrame.new(rs.C0.p, mouse.Hit.p)*CFrame.Angles(0, 0, math.rad(105))
ls.C0 = CFrame.new(ls.C0.p, mouse.Hit.p)*CFrame.Angles(0, 0, math.rad(-100))
mousemove = false
end
end)
end

script.Parent.Selected:connect(lajoijigpoiqhgkngkngoigniwgn)
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
15 Aug 2013 02:52 PM
C0 and C1 are offsets, not global positions
and
weld the arms to the head and rotate the head

local offset = CFrame.new(0, 1.5, 0) -- change this to the head's offset to the torso, i think this is right
headweld.C1 = (CFrame.new(head.Position, m.Hit.lookVector) - head.Position) * offset
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 02:58 PM
@FreeToTake

I would have to re-write my animations, and re-measure my welds to use that.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
15 Aug 2013 09:11 PM
bump,
Report Abuse
johnhugh is not online. johnhugh
Joined: 26 Mar 2009
Total Posts: 1971
15 Aug 2013 09:21 PM
was about to bump for you, because I, also, need this to work for my guns >.>
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
16 Aug 2013 12:22 AM
Lolok
Report Abuse
johnhugh is not online. johnhugh
Joined: 26 Mar 2009
Total Posts: 1971
16 Aug 2013 06:47 AM
bomp
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
16 Aug 2013 06:57 AM
CFrame.new(start, end):toObjectSpace(Torso.CFrame)

Try that.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
16 Aug 2013 10:31 AM
Could you explain that for me? I don't know what start, end is.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
16 Aug 2013 10:38 AM
Start is your Left Arms (shoulders?) position, End is your mouse cursor.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
16 Aug 2013 10:41 AM
Does the position show correctly if the Arms are welded? Because I only know their weld positions.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
16 Aug 2013 10:55 AM
So would rarm.CFrame.p show the correct CFrame even if it was welded? Because usually the Position property looks like it doesn't change.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
16 Aug 2013 10:58 AM
Yeah... Because the position property changes...
Report Abuse
BIGBUCKS999 is not online. BIGBUCKS999
Joined: 26 Feb 2010
Total Posts: 6524
16 Aug 2013 11:03 AM
I've done this before,
I think I know how to do it, but just let me find the gun I did it for to make sure.

- Bigbucks
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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