Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is the most conventional / appropriate way to move a players arms relative to a tool?

While there are many ways to weld a players arms in a fix position; such as when a player is wielding a weapon, I would like to know what is the most appropriate way to do so. Should it be done with animations, welding, or another format?

1 answer

✓ Accepted answer

How a appropriate a given technique is will depend entirely on your requirements, there is no universally correct method.

If you don't want high-fidelity dynamic animation or if you want to minimise CPU and networking performance costs, use ROBLOX's animation system. It will behave well with Filtering Enabled and provides more efficient keyframe interpolation than you can achieve with custom animation code in Lua.

Welds, on the other hand, can be computationally expensive to update - whether they are a good solution or not depends on how heavy your geometric calculations are, which interpolation methods are used, how the animation system is implemented, and the update rate, etc..

I like to animate dynamically with welds (in response to the environment or player input) to provide interactive visual feedback. This doesn't always play well with Filtering, can be slow for both clients and the server (can't send part positions at the speed which they are animated), and won't look good to other players without some higher-level synchronisation system (e.g. telling each client who is using what animation mode so that each client can recreate the animation for each player).

Basically, use ROBLOX's animation system if your animations aren't dynamic.

As a side note, I sometimes make whole character animations programmatically (i.e. using welds, oscillation functions like sine/cosine, interpolation, etc..) and I wrote a script a long time ago that samples these procedural animations with a given frequency to make regular KeyframeSequence objects. Let me know if you're interested in how that works.

2 comments

0

Thanks for the reply, it was very insightful. I'd love to find out more about that; whatever you can send / tell me is of great help!

0

Have a look at the API wiki pages for KeyframeSequence, Keyframe, Pose, and CFrame. You can build KeyframeSequence objects programmatically and then turn them into Animation objects. See this question: https://scriptinghelpers.org/questions/18916/upload-custom-keyframesequences-as-animation-assets

This discussion is preserved as it was. New answers, comments, and votes are closed.