SENT Collision

Hey guys,

My SENT (Scripted Entity) when deployed only has a 5% chance of being injured (as in, only one spot hurts it, nowhere else). I am not sure what the issue is, but I have tried this:

[lua]function ENT:Initialize()
if (!SERVER) then return end
self.Entity.IsDrHax = true


self:PhysicsInit( SOLID_VPHYSICS ) – Make us work with physics,
self:SetMoveType( MOVETYPE_STEP ) – after all, gmod is a physics
self:SetSolid( SOLID_VPHYSICS ) – Toolbox
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
print(“WE ARE VALID!”)

min, max = Vector(-20,-20,0), Vector(20,20,64)

self:SetCollisionBounds(min, max)


However, the collision is still messed up. Can anyone help me?

What is the entity type/base?

The entity type and base are:

[lua]ENT.Base = “base_ai”
ENT.Type = “ai”[/lua]

self.Entity is deprecated, you can just use self.

also is this meant to be an NPC? if not use [lua]ENT.Base = “base_anim” ENT.Type = “anim”[/lua]

also your validity check for the physicsobject isnt exactly correct:
[lua]if (phys && phys != NULL && phys:IsValid()) then[/lua]

[editline]9th March 2013[/editline]

also the movetype: self:SetMoveType( MOVETYPE_VPHYSICS )

[editline]9th March 2013[/editline]

and your collision box is relative to the world and not the sent, which means it will only collide if the collision takes place on those coords on the world (close to 0, 0, 0) you need to use something like self:WorldToLocal(min) self:WorldToLocal(max) then use those to setup your collision box

Nevermind, it turns our I had to do

[lua]self:SetSolid( SOLID_BBOX )[/lua]