How to make a incredibly simple viewmodel position script! part1

Okay!
Some people make viewmodels seam like a massive feat! Well, today you will make one in under 5 minutes!

Step 1 Adding the rig!

Import this rig into your game!

Step 2 Welding!
Download the rig edit lite plugin!

Add a gun to your game, then put the gun parts into your rig, position the parts.


Now open rig edit lite!
Screen Shot 2022-06-19 at 9.20.23 PM
Select the part called HumanoidRootPart then select a part named handle, if you don’t have a part named handle then select a part that is not the mag or the bolt. Press create joints.

Now grab the handle and select all of the parts that were a part of your gun except for mag and bolt (if there is mag and bolt parts) Now press weld.
Screen Shot 2022-06-19 at 9.19.58 PM
You are ready for step 3, but before that make sure all of the parts are unanchored and cancolide off.
Step 3 Scripting!
This is the easiest part, just create a local script in the rig and paste this,
(this will make your rig be positioned in the cameras position.

local RATE_PER_SECOND = 0
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function(step)
	local increment = RATE_PER_SECOND * step
	script.Parent.PrimaryPart.CFrame = game.Workspace.CurrentCamera.CFrame
end)

Now put this in starter character.


Now add onto the script and paste this,

local RATE_PER_SECOND = 0
RunService.RenderStepped:Connect(function(step)
	local increment = RATE_PER_SECOND * step
	for index, instance in pairs(script.Parent:GetDescendants()) do 
		if instance:IsA("BasePart") then
			instance.LocalTransparencyModifier = 0
		end
	end
end)

Finally you are done and your viewmodel is complete, make sure to like and comment if you need help.

part 2

part 3:

9 Likes

Thanks
If I made an FPS game, I would use this

One thing I would reccomend is that you explain the script

When will part 2 be out?

2 Likes

Part 2 will be made today! qwew

1 Like

Decent tutorial, but what’s the point of “RATE_PER_SECOND” and “increment”? They’re not used, why not remove them? Also, you can just combine these 2 RenderStepped events into one.

tip: use PivotTo() instead of PrimaryPart.CFrame

Whoops sorry I was looking at my previous view model.

How to make an Fps viewmodel part 2! Anims and damage script its out!

1 Like

Cool! Im making a survival game and i was having trouble with viewmodels because i wasnt familair with them this helps me alot!

1 Like

oh yeah also for some reason the viewmodel appears for a second but then dissappears how do i fix that i have both anchored and can collide off btw

is the humanoidroot part anchored because it needs to be

alright then I will try that man