Making Objects 'Wobble' With sin/cos Function

https://gyazo.com/e09b44d7546e6bd050f500bb20ee9f0e
I have these daggers hovering over the player, and I was wondering if there was a good way to make them oscillate up and down and left and right slightly. I am also wondering if there is a way to similarly have the objects slowly spin around too.
I know I could use a while loop and move through a sin/cos function, but I was wondering if there was a better way to do such a thing.
Thanks!

You could change the orientation of the dagger.

You’re right that you could use a while loop (or maybe better yet heartbeat) to iterate through a sin or cos curve. However, Roblox also offers the tween service, which I would probably point you to as a better way to go about this.

I would recommend tweening because it’s easy to setup and configure, and if memory serves me right there is a sin or cos curve option available. Plus, it’s easy to loop a tween with minimal scripting effort, and it generally looks very smooth.

1 Like

Alright, thanks! I might mess around with the tweenservice and see if theres something that works.

1 Like

I believe you could use the spring module to shove the dagger position