In this gif you can see those pets are moving relative to the character but they also have the added bobbing effect and they move very smoothly (not like being welded to the character). How could I replicate this bobbing effect?
Ok what do I do with tweenservice to make the pet so “bouncy” and life-like. Its not like a cube thats just moving around with tweenservice or being welded to the character. The choco bunny bet I had also bounces up and down as it moves.
They appear to be moving up and down, but also just tilting back and forth. The tweenservice will do both of those with mathematical graduations. Heheh, like snorebear just said.
If you make all of the highly visual aspects of your game (like animated objects and projectiles) animated completely client-sided, they will always look very smooth. Those are the perks of offloading animations/visuals to the clients instead of doing it all on the server or the network owner of the pets.
Alright i’ll do my effects client side. Problem is that I still have no idea how to replicate the motion of the pet. Somehow i’m supposed to use tweenservice and moveto magic with humanoids .
You could animate the pets entirely by cframe if you really wanted to by using lerp and sine waves. Also, the pets dont have to be perfectly accurate on all systems. They just need to be roughly in the same place.
Animating entirely by cframe sounds good. But how Theres like a tilt and bobbing motion plus the pet follows the motion of the character. I cannot fathom how to apply all three of these at once. If I weld the pet then it can’t do the bobbing.
It interpolates from one CFrame to the other by using a percentage.
You can visualize it by taking a point and at 0% its at the start of a line, at 100% its at the end of the line, and at 50% its halfway between the start and end.
local function lerp(a,b,c) return a + (b - a) * c end
print(lerp(5, 10, 0)) --5
print(lerp(5, 10, 1)) --10
print(lerp(5, 10, 0.5)) --7.5
I wanna weld some part to the character, this part’s cframe is gonna be attachCFrame. Then I lerp from that cframe according to the cosine function thingy you wrote. Idk what the i variable is for
The i variable is just for the index of the pet, as you will probably do this for all pets. This will make them have a sort of wave-like motion because each pet will be offsetted.