RunService.RenderStepped:Connect(function()
local objectspace = HumanoidRootPart.CFrame:toObjectSpace(Camera.CFrame).LookVector
HumanoidRootPart.CFrame = HumanoidRootPart.CFrame * Angle(zero, -math.asin(objectspace.X), zero)
end)
This scripts goal is to replace Humanoid.AutoRotate it does it well but i want it to run faster.
Any Help Appreciated!
4 Likes
Staric14
(Dersty)
July 18, 2023, 7:49pm
#2
Maybe Heartbeat instead RenderStepped?
4 Likes
I tried this but it’s not any faster
3 Likes
Staric14
(Dersty)
July 18, 2023, 7:56pm
#4
Wait, I test it in my studio to test. I will edit this message right now!
It’s localscript? Yes it’s localscript because renderstepped
3 Likes
Yeah the problem is if I turn my camera too fast it looks weird
2 Likes
Staric14
(Dersty)
July 18, 2023, 8:09pm
#6
Maybe:
Camera.Changed:Connect(function()
local objectspace = HumanoidRootPart.CFrame:toObjectSpace(Camera.CFrame).LookVector
HumanoidRootPart.CFrame = HumanoidRootPart.CFrame * Angle(zero, -math.asin(objectspace.X), zero)
end)
2 Likes
Anything else a little bit faster than Camera.Changed? because the character still can’t keep up with the camera.
2 Likes
Staric14
(Dersty)
July 18, 2023, 8:33pm
#8
while true do
local objectspace = HumanoidRootPart.CFrame:toObjectSpace(Camera.CFrame).LookVector
HumanoidRootPart.CFrame = HumanoidRootPart.CFrame * Angle(zero, -math.asin(objectspace.X), zero)
Camera.Changed:Wait()
end
I don’t know what can be faster
3 Likes
Ok so, I found the solution, I just decided to Lerp the HumanoidRootPart to the camera lookvector but thanks for the help @Staric14
3 Likes
There is no way to make this run ““faster””. RenderStepped
and all subsequent RunService
functions fire whenever a new frame has been rendered. What you need to do is set a speed variable for how fast the character rotates, and adjust it to the DeltaTime of each frame.
3 Likes
system
(system)
Closed
January 3, 2024, 6:56pm
#14
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.