Ok so i want to click lets say R button on the keyboard and then player moves forward slowly
like this https://gyazo.com/f7f6bfef5a6fe329116befe4556fa7cf
Right now
https://gyazo.com/41bfd611c169c20e8c54168bc1adf427
i just used animation but camera stays in place and player comes back after its finished.
help :)
In the example you used its obvious that you tried to use the character animations, I will tell you this now, this will NEVER work, animations will only move character parts/joints never the HumanoidRootPart (Which is where the camera is centered on). You can fix all this by using a body velocity. (Also make sure to have the animation not move the character or else it will do both movements at the same time). Makes sure this is all a local script.
local player = game:GetService("Players").LocalPlayer local Character = player.Character or player.CharacterAdded:Wait() local RootPart = Character.HumanoidRootPart -- if you already have the variables above in your own script there is no need to write them again --instead of using animations we will use a bodyvelocity, it is basically speed in a given direction local BV = Instance.new("BodyVelocity") BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge) --in order to make the character actually move, we will give them speed in the direction they are facing BV.Velocity = RootPart.CFrame.lookVector.Unit * 50 -- you can change this if its too fast or too slow --make sure it is parented to the "HumanoidRootPart" if it's not the script won't work. BV.Parent = RootPart wait(2) -- or however long you want the speed to last BV:Destroy()
I hope this fixed your problem and please mark this as the answer if so! :)