I want something like this:
I want it to be cframe or any solution and not animated.
I want the right arm to point at the mouse.
I want the left arm to hold the right arm.
Edit: I already know how to make the arms point, all i need is to weld the left arm to the right arm in this position.
Final Script: How to CFrame the Arms? - #16 by InvalidRaycast
4 Likes
well you could do math to set the Motor6D for the right arm to point towards the mouse, and then do the same with the left arm using a predetermined offset based on the right arm.
2 Likes
boisdeleau
(boisdeleau)
January 21, 2024, 4:59am
#3
Im guessing that this is a gun holding thing. You could use some maths to make the arm always point the gun or item the character is holding.
1 Like
what do you mean by this? do you mean to make me set the position of the left arm to the right arm and then add some CFrame offset?
Something like:
LeftArm.CFrame = RightArm.CFrame *
CFrame.Angles(math.rad(35),0,0) * -- Angle Offset
CFrame.new(1,0,0) -- Position Offset
Could you elaborate your solution? i don’t understand it.
boisdeleau
(boisdeleau)
January 21, 2024, 5:01am
#6
What I mean is making the motor6D of the second arm poiting at the end of the main arm.
Edit: I already know how to make the arms point, all i need is to weld the left arm to the right arm in this position.
for this you need to use Cframe:lookAt(“”)
Are you telling me to make an attachment to the right arm then the left arm of the character is pointing to the World CFrame of the attachment?
boisdeleau
(boisdeleau)
January 21, 2024, 5:10am
#10
Well not really I wouldn’t use welds for what you’re trying to achieve. I did something similar in the past where I used a lot of maths to rotate the C0 of the motor6D to a part. What I would do is make the maths and apply them everytime the mouse moves.
Didn’t say “welds” but are you trying to tell me to make C0 of the left arm motor6d point at the Right Hand/(Furthest point of the Right arm)
1 Like
boisdeleau
(boisdeleau)
January 21, 2024, 5:16am
#12
Yeah pretty much. If you need help with the maths I can always give you what I did but I don’t think it would be optimal for what you’re trying to achieve.
1 Like
It seems like this isn’t a solution at all because I’m operating it in a TPM/Third Person Mode. It would work for guns if it is indeed FPS, but if the user points at the further right, it might not work.
boisdeleau
(boisdeleau)
January 21, 2024, 5:25am
#14
Oh yeah that wouldn’t work, in my case the character was locked into position. Still I think it’s motor6d manipulation.
No, using the motor6D. The arms of a roblox character are connected by motor6D welds that are inside the HumanoidRootPart. You can set offsets from here
Thanks for your solution, after scripting I made a script that does what i needed.
Here’s my script so users who needed it, you can grab it.
local LArmWeld = Instance.new("Weld")
LArmWeld.Part0 = Character:FindFirstChild('Right Arm')
LArmWeld.Part1 = Character:FindFirstChild('Left Arm')
LArmWeld.Parent = Character
LArmWeld.C0 = Character:FindFirstChild('Torso'):FindFirstChild('Right Shoulder').C0 *CFrame.new(0,0.1,-2.5) *CFrame.Angles(-math.rad(25),0,0)
LArmWeld.C1 = Character:FindFirstChild('Torso'):FindFirstChild('Right Shoulder').C1
Take note:
You don’t need to put this in RunService, all you need to do is put it in a spawn()
function
Requirements:
You must be in R6
You must use this script:
I tinkered with your code a bit and managed to get it working. Here is what I did:
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local plr = Players.LocalPlayer
local char = plr.Character
local mouse = plr:GetMouse()
local armOffset = char.UpperTorso.CFrame:Inverse() * char.RightUpperArm.CFrame
local armWeld = Instance.new("Weld")
armWeld.Part0 = char.UpperTorso
armWeld.Part1 = char.RightUpperArm
armWeld.Parent = char
RunService.Heartbeat:Connec…
1 Like
Not what I made but I already finished it, thanks for giving me ideas perhaps.
1 Like
system
(system)
Closed
February 4, 2024, 6:08am
#18
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.