How to make a gun sway script?

I’ve already seen a few other threads on this but all the answers are useless. If anyone can help me it will be greatly appreciated c:

2 Likes

What do you mean by a “gun sway script”?

Please could you show me examples of what you mean or elaborate on your idea further so I can help you out. :smile:

Like this here, found it on another thread. https://gfycat.com/sillyindolentamericanshorthair

hopefully that link works

Could you explain what you mean that the answers are supposedly useless? Is that you can’t understand them or you haven’t tried them?

Gun sway can be accomplished in several different ways and the threads here often have them specific to a certain implementation. You can salvage them or try creating a system based off of the concepts they lay forth.

2 Likes

Oh, thanks.

I think you can recreate this effect by either lerping/using TweenService to get to the effect you’re after.

How so? Well, what you can do is tween/lerp the gun model to the position in front of the player so that it’s always travelling to the end position.

Here are some helpful links:

I don’t think this would achieve what the user is asking for at all. This is a request to have the arms moving “sway” when they move.

@DavidDRothschild I’d recommend reading this post: The First Person Element Of A First Person Shooter

The code in the example place has sway included in it. Take a look :slight_smile:

Can’t you achieve that with inverse kinetic animations? I’m not very experienced with animations myself but I’m pretty sure you can. I may be wrong though so not sure.

Inverse Kinetic is not a concept - I believe you’re referring to Inverse Kinematics, which no, is not a way you can achieve this.

1 Like

They use springs which are laggy, they use renderstepped which can bug easily with an FPS unlocker or the code is too incomplete to make it work.

These are all non-problems and have confirmed for me that you have not tried resolving this yourself or testing those solutions before bringing this question to a thread.

Springs are not at all laggy; if you are encountering “lag”, then you are most likely handling them the wrong way. The client is capable of applying movement for springs very smoothly as with all other client-side solutions. A custom spring solution is also valid if you find yourself needing it.

RenderStepped does not bug with FPS unlockers, it works exactly as intended at all times. RenderStepped runs every frame. You yourself need to account for these cases by using the delta time property passed to RenderStepped.

2 Likes