So I made my jail for my mode become its own entity instead of being a prop_physics, so that I could isolate it with FindByClass to draw an icon over it. The problem is now, that anything behind it will be drawn in front of it. I may be a noob, but I have no idea what it could be. I’m probably missing some pieces of code in the sent_jail.lua file. Here’s an image to show what I mean:
The SENT code is very minimal as most detail is set in the weapons function, but here is it anyway:
ENT.Type = "anim" --ENT.Base = "base_entity" ENT.PrintName = "Jail" ENT.Author = "" ENT.Contact = "" ENT.Purpose = "Unique Class name" ENT.Instructions = "Don't use it" if SERVER then function ENT:Initialize() self:SetModel( "models/props_sdk/jail.mdl" ) self:PhysicsInit( SOLID_VPHYSICS ) --self:SetMoveType( MOVETYPE_NONE ) self:SetSolid( SOLID_VPHYSICS ) self:SetMaterial("models/props_combine/portalball001_sheet") local phys = self:GetPhysicsObject() if (phys:IsValid()) then phys:Wake() end end end
[editline]6th July 2014[/editline]
I do still not know what was wrong, but I did a workaround to fix it, where I went back to using prop_physics and made sent_jail an additional entity which is not drawn and has no physics, only really there to mark the point for the icon. So the problem is fixed, but someone else might have the same problem, so post solutions if you still have any.