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: 'Pointing' a Character's Right Arm

Previous Thread :: Next Thread 
popdosprlte is not online. popdosprlte
Joined: 18 Dec 2009
Total Posts: 4801
10 May 2013 06:57 PM
I'm trying to figure out how to point a character's arm at the mouse's current location.
However, I have no clue how to do this. I've tried in vain to understand welds and cframes, but alas I only grasp the basics of these two. Could anyone help me figure how to get a character's arm to point towards the mouse's location?
Report Abuse
popdosprlte is not online. popdosprlte
Joined: 18 Dec 2009
Total Posts: 4801
10 May 2013 08:09 PM
Is there anyone to help me?
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
10 May 2013 08:10 PM
It's quite an involved calculation, let me see if I can dig it up...
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
10 May 2013 08:14 PM
This is how I did it:

    local j=the player's shoulder joint
    local torso=the player's torso
    local targetPosition=point to point at
    
    --This part sets up the joint (only have to do it once)
    j.C0=CFrame.new(1.5,0.5,0)--Do -1.5 if you want the left shoulder
    j.C1=CFrame.new(0,0.5,0, 1,0,0, 0,0,1, 0,-1,0)
    
    --This part points it (do this every time you want it to point)
    local pos=torso.CFrame:pointToObjectSpace(targetPosition)
    j.C0=CFrame.new(Vector3.new(1.5,0.5,0),pos)--here too
Report Abuse
popdosprlte is not online. popdosprlte
Joined: 18 Dec 2009
Total Posts: 4801
11 May 2013 12:50 PM
Your code works rather well, but when a gun is welded traditionally onto the arm, it is held to the side similar to a try-hard 'thug' type of person.
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