• Why is this nonsolid to players?
    5 replies, posted
[lua] function ENT:SpawnFunction( ply, tr ) if ( !tr.Hit ) then return end local SpawnPos = tr.HitPos + tr.HitNormal + Vector(0,0,100) local ent = ents.Create( self.Classname ) ent:SetPos( SpawnPos ) ent:SetOwner(ply) ent:Spawn() return ent end function ENT:Initialize() self.Entity:SetModel("models/props/futbol_dispenser.mdl") self.Entity:PhysicsInit(SOLID_VPHYSICS) self.Entity:SetCollisionGroup(COLLISION_GROUP_NONE) self.Entity:SetPos(self.Entity:GetPos()) --if SERVER then self:PhysicsInit( SOLID_VPHYSICS ) self:SetMoveType( MOVETYPE_VPHYSICS ) self:SetSolid( SOLID_VPHYSICS ) local phys = self.Entity:GetPhysicsObject() if phys:IsValid() then phys:SetMass(0.5) phys:Wake() --end end end [/lua] Haven't any idea why this lets players just walk through.
SetCollisionGroup(COLLISION_GROUP_NONE) Of course it doesn't collide.
I removed it, still nothing. COLLISION_GROUP_NONE -- This is the default collision group, collides with static and dynamic
Doesn't using Entity:SetOwner() disable collisions between said player, and the ent? Perhaps see how your prop protection handles owners, and then set it like that. Entity:SetNWString("owner", ply) or Entity.Owner = ply perhaps.
[QUOTE=amkoc;29920087]I removed it, still nothing. COLLISION_GROUP_NONE -- This is the default collision group, collides with static and dynamic[/QUOTE] Try COLLISION_GROUP_INTERACTIVE [editline]19th May 2011[/editline] [QUOTE=jimbodude;29923748]Doesn't using Entity:SetOwner() disable collisions between said player, and the ent? Perhaps see how your prop protection handles owners, and then set it like that. Entity:SetNWString("owner", ply) or Entity.Owner = ply perhaps.[/QUOTE] Didn't notice that, but yes. Entities do not collide with their owner (As normally owned entities are weapons, and having weapons collide with players would be problematic)
[QUOTE=jimbodude;29923748]Doesn't using Entity:SetOwner() disable collisions between said player, and the ent?[/QUOTE] o_o Thanks!
Sorry, you need to Log In to post a reply to this thread.