Hey guys Im trying to recreate a tool bobbing script that you would probably see in an advance FPS game where the guns and the player's arms bob while they move. However, I have no idea how to start it. I had an idea of using CFrames in my gun script to edit the welds to bob the weapons but Im not very good at making the bobbing realistic. Is there an easier way or do I really have to program each CFrame to make a bobbing animation?
Here's the code that I use to make the arms weld to the gun in a certain position:
leftWeld.C1 = cframe(0.8,0.5,0.4)* CFrame.Angles(math.rad(270),math.rad(40),0)
rightWeld.C1 = cframe(-1.2,0.5,0.4)* CFrame.Angles(math.rad(270),math.rad(-5),0)
This is the starting position of my weapon. left and right weld are obviously the welds that control the player's arms. All in all, I just need a script that bobs the guns/player arms while the player moves. Thanks. |