I’m having a strange issue right now where the view model of the tool gun will appear to be the world model. The only thing that’s missing is the hand holding it. I’ve written a small script in an attempt to debug this issue:
local function WhatsMyVM( ply, cmd, args )
local ent = ply:GetViewModel()
if IsValid( ent ) then
local mdl = ent:GetModel()
print( "Current view model: "…mdl )
local wep = ply:GetActiveWeapon() if IsValid( wep ) then print( "You are currently holding "..wep:GetClass() ) print( "Wep's model is: "..wep:GetModel() ) print( "The weapons table is as follows:" ) PrintTable( wep:GetTable() ) end
concommand.Add( “ldrp_dbgvm”, WhatsMyVM, nil, “Prints the view model and other information of the currently held weapon.” )
Which outputs the following (minus the table):
As I understand it, c_toolgun is supposed to be a proper view model. However, for what ever reason, my game mode is still drawing it as the world model. I don’t have gmod_tool defined in my game mode’s entities/weapons folder, nor can I think of anything that would override the view model (without somehow changing what GetViewModel() receives).
I know this is really shooting in the dark, but can anyone think of any code that might be changing the tool gun’s view model in a such a way that the game doesn’t seem to perceive it as being changed?