privated, atleast30charsatleast30charsatleast30chars
I’ve done this already using an IKControl. It’s really simple. You just create the IKControl, set its EndEffector to the head and the ChainRoot to UpperTorso, set the type to LookAt, and then you can simply use a small part that you position in front of the camera and the character will automatically look at it.
Ye obviously you’ll have to disable the old script. Keep it commented and see if you can make it work through a IKControl
No it doesn’t have to face the camera, as IKControl doesn’t use the CFrame but only the position. I’ve done it this way:
-- In your client script
local lookPart = Instance.new("Part");
lookPart.Size = Vector3.new(.1, .1, .1);
lookPart.Transparency = 1;
lookPart.CanCollide = false;
lookPart.Anchored = true;
lookPart.Parent = workspace;
-- create the ikcontrol and set every property, I won't write all of them
IKControl.Type = Enum.IKControlType.LookAt;
IKControl.Target = lookPart;
IKControl.EndEffector = character.Head;
IKControl.ChainRoot = character.UpperTorso;
RunService.PreRender:Connect(function()
-- so the part is constantly in front of the camera
lookPart.Position = (camera.CFrame * CFrame.new(0, 0, -75)).Position;
end);
oh, that is not what i expected i thought i was supposed to weld it to the camera. ah. anyways, now i get it. okay okay okay im gonna rewrite and modify the code and see if i could get my own version of this to work. ill make your reply solution if it works. I greatly appreciate you helping me!
Edit: IT WORKS! YES! FINALLY! THANK YOU THANK YOU THANK YOU! my god 4 hours of trying to fix my old code and all i could have done was use an ikcontroller! again thank you so much for helping me!
No worries, IKControls are really useful and simplify something that would take a long time to code. Glad I could help
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.