• Making some models gravgunable
    9 replies, posted
Hello, i have the problem that when i create an entity with the model lets say of a potato (models/props_phx/misc/potato.mdl) then i cant pick it up with the gravity gun. here is the init of the entity [CODE] function ENT:Initialize() self.Entity:SetModel("models/props_phx/misc/potato.mdl") self.Entity:PhysicsInit(SOLID_VPHYSICS) self.Entity:SetMoveType(MOVETYPE_VPHYSICS) self.Entity:SetSolid(SOLID_VPHYSICS) self.Entity:SetUseType(SIMPLE_USE) self.Entity:SetColor( Color( 255, 255, 255, 255 ) ) local phys = self.Entity:GetPhysicsObject() if phys and phys:IsValid() then phys:Wake() end phys:SetMass( 300 ) self.sparking = false self.damage = 50 end [/CODE]
Does no one of the Lua gods in here have a clue?
I haven't tested this, but you could mess with the [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/GravGunPickupAllowed]GM/GravGunPickupAllowed[/url] hook.
Nope still can't pickup the entity. Besides even the normal model directly spawned from the menu isnt pickupable via gravity gun.
iirc the max mass for the gravgun is 200, not 300. Have you tried using a lower number?
still not "gravgunable" with a mass of 200
I wonder if it's to do with the models size. Have you tried scaling it's hull?
nope not tried yet but I think I don't tried it because i don't know how
[QUOTE=Mrkrabz;47551473]iirc the max mass for the gravgun is 200, not 300. Have you tried using a lower number?[/QUOTE] It's 250. It's something to do with the model in this case, not the weight. [editline]18th April 2015[/editline] Try calling [code] self:PhysicsInitSphere( 1 )[/code] And do not use self.Entity. Use just self.
Thx Robotboy655 that fixed the problem.
Sorry, you need to Log In to post a reply to this thread.