Entity Weight/Mass Issues

I have a mdl file that has a weight which is too high, (I can’t change it in the mdl file because it wouldn’t compile right again, sorry.) I’m using the mdl for an entity, I’m trying to figure out how to set it’s mass/weight in lua. I’ve tried using:

[lua]
ENT.MASS = 15;
[/lua]

It doesn’t appear to work properly once it’s spawned.

Thanks in advance,
wtr

I’ve actually tried that already too, it didn’t appear to work either.

Show the code you used and I’ll tell you what you did wrong.

It’s below, spawns perfect and everything, the mass just doesn’t set.

[lua]
function ENT:SpawnFunction( ply, tr )

if ( !tr.Hit ) then return end 
 
local SpawnPos = tr.HitPos + tr.HitNormal * 16 
 
local ent = ents.Create( self.Classname ) 
	ent:SetPos( SpawnPos ) 
ent:Spawn() 
phys:SetMass( 15 )
ent:Activate() 


 
return ent 

end
[/lua]

phys is nil, where did you think you could get it from?

Use ent:GetPhysicsObject():SetMass(15)

Still didn’t correct the mass, It’s still using the same mass as listed in the actual MDL file. Thanks for being so quick with replies.

You have to use
[LUA]
function ENT:Initialize()
Use ent:GetPhysicsObject():SetMass(15)
[/LUA]

The mdl file is being called from an init, that function is just the actual spawning, so I’m already doing what you said.