Each time this code is ran, the character will face towards the same direction if not in shiftlock (The direction is always the same, seems to be pointed at 0,0,0?), and I’m unsure of the cause.
Isn’t body velocity supposed to be depreciated now? I’ve tried with LinearVelocity before and imo the results didn’t feel right, but i might check it out again thanks!
Hey there, this seems to be due to an oversight in your use of CFrames.
CFrames, or CoordinateFrames, contain a given parts position and rotation.
However when you are tweening, you create a new CFrame, without giving it a rotation, so it will default to (0, 0, 0). Essentially, you are resetting your character’s orientation every time you tween their position.
Instead you could change your Tween from
local tween = TweenService:Create(root, tweeninfo, {CFrame = root.CFrame * CFrame.new(0,0,-3)})
Given that multiplying CFrames results in moving the part in Object space, you are still achieving the effect of moving the character 3 studs in the direction they are looking. However this way, you are creating the new CFrame with the root’s CFrame as a base, and thus keeping it’s rotation.