Writing an FPS framework (2020)

image
(and properties entries)

Im having a few problems with your FPS Framework. I keep getting an error saying “Attempt to index nil with ‘Destroy’”
error1 error2 error3

1 Like

Nevermind i found out why it was happening. I accidentally made “WeaponName” a string

2 Likes

TLDR: aim offset doesn’t work when I paste it into weapon offset. It gets stuck at idle position Didn’t change a single code.

After properly reading the tutorial and scrolling through the replies, i’ve come to believe that i am somewhat capable in changing the offsets. As you can see at idle the gun is not in my face. I’ve tried doing the same for the aim offset but unfortunately it didn’t quite work for me even though I left everything untouched. Lemme elaborate:

First I went through trial and error to find decent looking offsets. Then I copied both offsets from the workplace viewmodel during testing and replaced the m4a4 offsets with them in edit mode. The idle offset worked but when I tried to aim, the gun just stopped swaying. No ADS. It was stuck at the idle coords. Until I typed in the command again which got it working again. It breaks everytime I when unequip it.

I’d really like to use these offsets as they would make adding and adjusting different guns much easier. So I’d really appreciate the help!

1 Like

It’s not supposed to work with that viewmodel? I was hoping to learn how to get things working properly first and make my own viewmodel later, but I guess that is too much to ask for from such an excellent tutorial. Well anyways, thank you for your time! I’m sure you are a busy guy and have much better use of your time other than replying to an ultra noob like me, so once again, thank you!

It is, but you’re copying values you’re not even editing. look at the command.

1 Like

I was supposed to use game.ReplicatedStorage.weapons.m4a4.offsets instead of workspace.viewmodels.offsets … of course. Found that out after looking at the tutorial photos. Maybe if I started learning scripting before yesterday I would’ve known better. You were literally spoon feeding me the answers and I couldn’t get it. Thanks a bunch for helping this noob out. People like me get better looking at good code and constantly annoying devs over problems they create themselves. Thamks again
cheems over and out

Pretty badass tutorial you got there

7 Likes

Great tutorial:

I have hundreds of open source gun models in my inventory for free if anyone needs them to keep working on a FPS framework:

5 Likes

This is really great, except for the fact when I do the Motor6d code, it moves the arms to the weapons instead of staying relative. Any ideas on how to fix this?

Could you provide more detail in PMs?

So I’ve gone through the whole thing, great tutorial btw, but I completely forget where to change the values for offsets and such

1 Like

(you need to reupload animations)
the offset values are inside the weapon’s “offsets” folder

3 Likes

I’m having an issue where the weapon pops in for a frame unanimated before playing the equip animation. I tried adding a check for whether the gun was equipped, but it still updated while it was unanimated.

2 Likes

Where do I place this? You didnt mention where

1 Like

ctrl+shift+f in the open source place

fixed it:

Once you’re done, let’s do some more lerping in the update() function:

It says

attempt to multiply a Vector3 with an incompatible value type or nil 

on line

self.springs.fire:shove(Vector3.new(0.03, 0, 0) * self.deltaTime * 60)

I tried printing self.deltaTime and it prints nil

heres the other code. I placed it in :update()

		local sway = self.springs.sway:update(deltaTime)
		local walkCycle = self.springs.walkCycle:update(deltaTime)
		local recoil = self.springs.fire:update(deltaTime)

		self.camera.CFrame = self.camera.CFrame * CFrame.Angles(recoil.x,recoil.y,recoil.z)

set self.deltaTime to the deltatime in the update function

2 Likes

What did you use to animate the viewmodel?

1 Like

moon animation suite and blender

1 Like