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:

ENT.MASS = 15;

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

Thanks in advance,

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.

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 ) 
phys:SetMass( 15 )

return ent 


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
function ENT:Initialize()
Use ent:GetPhysicsObject():SetMass(15)

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