Ok so right now im trying to create a pet follow system and while ive had a degree of success I am not pleased by my results. so currently what im doing in keeping a part relative to the player’s humanoidrootpart via renderstepped and then tweening the pet model up and down off that part which is giving me an result looking like this https://gyazo.com/3f179bda8d59d877a05b25336c150124
Im wondering how I can make the transition smoother with the pet following the player because right now it just feels like the pet is physically attached.
To make it simple and have you write less code, you could just put a BodyPosition inside the relative part. Then every game-tick, update the BodyPosition desired position to the prior relative position of the player. This will make your ‘pet’ feel ‘springy’ so that it doesn’t instantly move when you move.
Well, according to you, you are “keeping a part relative to the player’s humanoidrootpart via renderstepped and then tweening the pet model up and down”. It seems like all your part does is store a Vector3 position that the model is using for it’s tweening reference position. By doing what I instructed prior, all you are doing is just changing the reference part position in a different manner.
in RenderStepped when you update the part’s CFrame relative to the player’s CFrame, instead lerp it by 90% of so using the :Lerp method, and then apply the up/down tween translation afterwards. This’ll make it glide to follow the player but not feel like it is attached, and is a very simple change to make.
RunService.RenderStepped:Connect(function(dT)
local NewCF = HumanoidRootPart.CFrame * PetOffset --offset of hover eg cf(3,5,5)
Pet.RootPart.CFrame = Pet.RootPart.CFrame:Lerp(NewCF, .9) * TweenOffset
end)