#R6 Left Shoulder point to Mouse
1 messages · Page 1 of 1 (latest)
are you trying to make the player point their arm at the mouse?
have you gotten anything to work or somewhat work yet?
No, I scrapped every prototype I made, all of them only rotated the arm very very slightly
Then again I was using Cframe.Lookat
I think you can do it by modifying the target angles of the Motor6Ds in the character
i'll figure out which one rq
I'll switch to R6 to make sure
Yeah, thats what I was doing
It's called Left Shoulder, and it's a child of Torso
yeah i was testing and it doesnt look like its letting me change the current angle
it worked on R15 but not R6 ill see if i can figure out why
All of the resources i found were using R15
Maybe its a feature R6 lacks
oh i figured out how to do it i think
you have to change the orientation of the C0 and C1 properties
I know, I just don't know how to make it follow the mouse
so maybe something like this?
local function toDeg(rad) return rad*180/math.pi end
local rx,ry,rz = CFrame.lookAt(workspace.CurrentCamera.CFrame.Position, Mouse.Hit.Position):ToOrientation()
LeftShoulder.C0 = CFrame.new(LeftShoulder.C0.Position) * CFrame.fromOrientation(toDeg(rx),toDeg(ry),toDeg(rz))
in runservice loop
Whars with the camera?
** You are now Level 6! **
oh yeah it should probably be your players position
ok, the code i sent didnt work exactly but i should be able to get it working ill send once i find a working solution
you're welcome
ok i got it working this is probably a terrible solution cause i dont know how cframes work lol
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local LeftShoulder = script.Parent:WaitForChild("Torso"):WaitForChild("Left Shoulder")
RunService.RenderStepped:Connect(function()
local x1,y1,z1 = LocalPlayer.Character.PrimaryPart.CFrame:ToOrientation()
local rx,ry,rz = CFrame.lookAt(LocalPlayer.Character.PrimaryPart.Position, Mouse.Hit.Position):ToOrientation()
LeftShoulder.C1 = CFrame.new(LeftShoulder.C1.Position) * CFrame.fromAxisAngle(Vector3.new(0,-1,0), -math.pi/2) * CFrame.fromEulerAnglesXYZ(-rx - math.pi/2,-ry - math.pi/2, 0) * CFrame.fromOrientation(x1,y1,z1)
end)
and you will probably need to play an animation that keeps the left arm still so walking and stuff doesnt affect the pointing
Thanks dude!