How to make a gun reload animation where the old magazine is dropped?

This is what I’m going for:

4 Likes

Simply ask the server to do it?
spend 3 second setting up a remote event and debris service?

2 Likes

What you’re saying is kinda vague to me. Can you elaborate?

2 Likes

server:

local d = Game:GetService("Debris")
Game:GetService("ReplicatedStorage"):WaitForChild("Reliable/Unreliable RemoteEvent").OnServerEvent:Connect(function(player)
    local m= Game.ServerStorage.Magazine:Clone()
    m.Parent = workspace
    m.CFrame = player.Character.LeftHand.CFrame
d:Additem(m,16)
end)

client:

-- reload happens
Game:GetService("ReplicatedStorage"):WaitForChild("Reliable/Unreliable RemoteEvent"):FireServer()
1 Like

How would you make the magazine drop blend so well with the reload animation as seen in the video I linked? Your approach would look choppy & even then doesn’t account for the second magazine.

1 Like

if the goal is to blend well and not multiplayer, drop the magazine locally instead
instead of cloning a different magazine, clone the magazine in the character’s hands, set the original invisible until at hip, and ofcourse, use a no collision constraint

2 Likes

The falling magazine should be visible on the server. What I’m still caught up on is if I’m removing and adding parts to the tool (using Debris & Clone), how would I do the animating? because then I would be messing with the Motor6Ds that are animated in the tool

1 Like

if you need to replicate, you could either assign the physics to the client or have server see a different mag

you need not modify tool part. you turn the tool mag invisible for a short while, and un invisible when at hip. the cloned magazine clone to workspace or somewhere

2 Likes

Does your game involve cooking?

1 Like

I’ll test some ideas out, including yours and some of mine that I have in mind for how this reload effect is achieved. I’ll update this thread when I get around to it, but’ll leave it open for any new ideas

1 Like

On the server side, the animation plays there too, on the server literally just create the object on that frame

1 Like

To make it, you need to rig the gun, then by detecting if animation is playing you can destroy WeldConstraint or Motor6D if you wish to remove old magazine
Then to put new magazine you need to write the script that is making a new meshpart for magazine such as Instance.new(), if you need to get id to paste your mesh into a new mag you can copy an old one while it is not destroyed
When you want to destroy old magazine you can use DebrisService to copy id mesh while magazine is not removed

1 Like