I’m currently making a walking forward animation for an NPC, and when you play, the player camera will change to the NPC camera. using this script:
repeat
wait()
cam.CameraType = Enum.CameraType.Scriptable
until
cam.CameraType == Enum.CameraType.Scriptable
local function Cam()
camera.CFrame = camPart.CFrame
end
connection = game:GetService("RunService").RenderStepped:Connect(Cam)
Well, the script works perfectly fine on other animations, but for this walking animation, if you look at the server side, the animation works smoothly and goes forward, but if the player cam attaches to the NPC cam, the frame gets really choppy (the Ping is totally fine), After a few tests, I noticed that whenever the NPC moved out of the grid, the animation got laggy in NPC view (The player cam attaches to NPC cam).
Some solutions I have tried:
- Unarchored the humanoidrootpart ( I read somewhere they say if you don’t archor the humanoid rootpart, the grid will move with the animation), not working
- Using move to to move the NPC to the destination, The only problem with this is that the animation won’t fit smoothly and move well with the animation I made.
- Using moon animator probably work, but i need the animation event from “animation editor” (i don’t know if marker from “moon animator” work like animation event from “animation editor”)
Question
Can I somehow move the grid with the animation, or maybe have a bigger grid?
Or maybe some solution that can stop the lag