Position of SWEP view model and World Model wrong.
6 replies, posted
Hello there yet again,
So this time it's not specifically Lua but it's Gmod developing with Lua as a major part of it, so I didn't know where to put it.
I have a SWEP i've made using the TFA Base (I have been in touch with TFA, but this is something i've done wrong not him).
It's a ported model from Fallout New Vegas, and I followed Buu's tutorial on making viewmodels which seemed to be great and worked. I made the world model, compiled it all and set up the lua so on son, and yes I did animations too. But for some unknown reason, the SWEP isn't in the correct position with the hand. When I change SWEP.VMPos and SWEP.VMAngle, it simply moves the arms, not the actual weapon. I have no clue where I messed up here, if someone could help me out. It was slightly off place in third person too before I changed the aforementioned values and since changing them, I can no longer see the worldmodel in 3rd person.
I'm thinking i've probably messed up somewhere in the modelling/rigging side of things, but honestly I don't know. Ask any questions, for any info you need/want.
I used Blender for modelling, rigging and animating.
I'm using c arms
It does do the animations, just with the 9mm in the wrong place.
https://files.facepunch.com/forum/upload/268512/07680297-c627-4f14-9033-9f06be2c23f0/image.png
.Hope one of you can be of assistance <3
Thanks for reading!
Try spawning the model as a prop/effect, merging hands onto it and play an animation, see if it works correctly. If yes, then its a problem with Lua, if it is still broken, you probably messed up in Blender, and need to check the weight painting - if you move the bone the gun is weighted to, and the gun moves slower/faster than the bone, you need to reweight it with Auto-normalize enabled (which you forgot if this is the case). As for code-based problem, try changing the weapon's FOV to see if it just move everything (hand + gun) or just one of them, then its a bug in TFA Base of some sorts.
It's already apparent that it's moving both of the arms, with the weapon model remaining in the same position.
The bones and the weighted parts all move together just fine in Blender too.
And i'm gonna be entirely honest with you, i'm not absolutely sure how to do the merging onto the hands and animations in-game.
Thank you for replying though <3
You can use
https://steamcommunity.com/sharedfiles/filedetails/?id=170917418&searchtext=easy+tool
and
https://steamcommunity.com/sharedfiles/filedetails/?id=104604709&searchtext=easy+tool
to test out stuff like this
https://files.facepunch.com/forum/upload/268512/65353eae-5be1-4d80-a1c0-d79c59c29c52/image.png
The animations are still broken, including idle as you can see above. But the weight painting appears to be absolutely fine.
Would you mind uploading the source files (smds and qc), I can try and figure out what is wrong.
It's ok, but thank you! A friend had a look at it without me really knowing, and came to the conclusion that i'd simply misplaced the mesh in the reference
Sorry, you need to Log In to post a reply to this thread.