Like this insteaed of just going down without taking into account the velocity of the mouse hit
Also basically I want the arm to go the orientation ofthe look of the mouse which it goes around like a hollow sphere so when there are new objects it doesn’t just update like a very weirdly and stuff
So like a sphere and stuff and so it ignored the parts so it doesnt just go to the part because it appeared and stuff so basically just ignore everything for mouse hit is that possible can i do it pleas eplease please
Hello,
Does not solve my problem with the arm orientation relative to the mouse velocity direction and the ignore everything mouse.hit thing did you even bother to read my entire post?
my apologies, for ignore every thing mouse u could use
local mouseRaycastParams = RaycastParams.new() --workspace
local function getMouseHit()
local mousePos = userInputServ:GetMouseLocation()
local unitRay = camera:ViewportPointToRay(mousePos.X, mousePos.Y)
return workspace:Raycast(unitRay.Origin, unitRay.Direction * 250, mouseRaycastParams)
end
but for the velocity you could try using tween service
I would take a different approach. Instead, return the vector from the mouses hit to camera and the look vector of the arm. From there find the delta difference of the arm to the camera vector and interpolate that delta difference with quaternions so no arm breaking. See ego mooses thingie on advanced cframe tricks (aligning 2 vectors)
If you want to rotate it around a joint just update the c0 of that joint instead. If you want it to not be instant simply interpolate it. And for the ignore all objects simply apply a mouse filter
Hello,
This is my other post explaining further in depth how this works BTW.
Thought you guys should check it out to be able to help me more, pretty stuck right now.TheInfo I’ve gathered since this post is that it should actually go around in a sphere formation, an infinite amount of circle paths in every orientation basically, yeah, based on the movement of the mouse in the workspace allthewhile ignoring everything in workspace so there are no sudden moves. Gotchya.
Hello,
I watched through the entire 17 minute video And found no useful tips on how to apply this to a script, let alone my script which rotates the arm of a character, which needs the motor6d to be retained if the script is turned off.
After I heard your cries of help, I will try to show you my mediocre script.
RS.Heartbeat:Connect(function()
if Character and Character:FindFirstChild(Tool.Name) and Character:FindFirstChild("Torso") then
local RightShoulder,= Character.Torso:WaitForChild("Right Shoulder")
local X = -(math.asin((Mouse.Origin.p - Mouse.Hit.p).unit.y))
local _, Y, Z = RightShoulder.C0:ToEulerAnglesXYZ()
RightShoulder.C0 = CFrame.new(RightShoulder.C0.Position) * CFrame.Angles(X, Y, Z)
end
end)
RS = RunService, Character = the players character and Mouse is the Player:GetMouse()
Also this only works up and down, in R6 only. I belive you must find another Joint rather than “Right Shoulder”
Are you sure you are using R6 and an Tool? I forgot that the Tool variable should be the Tool the players needs to be equiped so the arm will follow the mouse. Deleting and Character:FindFirstChild(Tool.Name) will make it so no Tool is needed.
Hello,
I don’t want to use a tool for it yet, I just want it to work whenever for now before I empliment any activationl ogic. One thing to keep out on is that I want it to be togglable so when it turns off the arm returns back to normal and doesn’t break or stay in the same place