How would I go about making a holstered gun jiggle?

Howdy, I have been working on a game for the past couple of days now, and it includes guns that can be holstered on your back such as a rifle, however, what I am wondering is how can I make the gun have a little jiggle on your back when moving like so? (From the start to the first 8 seconds of the video)

Thanks for any replies in advance!

1 Like

You’d edit the weld’s C0 property depending on the character’s velocity.

Thanks for your reply! I am not too confident with weld C0’s and C1’s, is it possible you could drop an example of how I would do this please?

Cheers mate, I figured it out, thanks a lot!

1 Like

Hey, can you explain or giving me some examples? I really can’t understand how it works like.

Essentially I just worked with the velocity of the characters humanoid root part and then used tween service with a weld to make it move up and down depending on which direction the velocity is going. It was not really the most ideal solution to my problem so I scrapped it but it worked out alright for the effort I had put in. These are pretty much the main functions I used:

Code
local Tweens = {}

function CancelAllTweens()
	for i,v in pairs(Tweens) do
		table.remove(Tweens, i)
		v:Cancel()
		v:Destroy()
	end
	return
end

game:GetService("RunService").Stepped:Connect(function()
	if game.Players.BruceWayne5222.Character.Torso.Velocity.X < 0 or game.Players.BruceWayne5222.Character.Torso.Velocity.Y < 0 or game.Players.BruceWayne5222.Character.Torso.Velocity.Z < 0 then
		local Tween01 = game:GetService("TweenService"):Create(Weld02, TweenInfo.new(0.1), {C0 = CFrame.Angles(math.rad(0), math.rad(90), math.rad(45 - 15))})
		CancelAllTweens()
		table.insert(Tweens, Tween01)
		Tween01:Play()

	elseif game.Players.BruceWayne5222.Character.Torso.Velocity.X > 0 or game.Players.BruceWayne5222.Character.Torso.Velocity.Y > 0 or game.Players.BruceWayne5222.Character.Torso.Velocity.Z > 0 then
		local Tween02 = game:GetService("TweenService"):Create(Weld02, TweenInfo.new(0.1), {C0 = CFrame.Angles(math.rad(0), math.rad(90), math.rad(45 + 15))})
		CancelAllTweens()
		table.insert(Tweens, Tween02)
		Tween02:Play()

	else

		local Tween = game:GetService("TweenService"):Create(Weld02, TweenInfo.new(0.2, Enum.EasingStyle.Sine), {C0 = CFrame.Angles(math.rad(0), math.rad(90), math.rad(45))})
		CancelAllTweens()
		table.insert(Tweens, Tween)
		Tween:Play()
	end
end)
4 Likes

Thanks, i appreciate your help, some of guy said that he used ‘Spring Module’, i have no clue how it works like. But if you want, you could read about spring module and check it out! I will try your code, thanks.

Hmm where does the script go ? I don’t understand

i believe it goes in the model you use as a holster for your gun but i guess u gotta do a lil editing for it to work well.