1. Heyo!
    Just being cureous - is there a reliable way to remove collisions between some objects? I'm not very familliar with Unity, but the first thign I've tryed - Physics.IgnoreCollision(Collider, Collider, true);
    But that didn't work out.
    It looks like some entities in the world doesn't even have collider component in them. only in childs.
    I was working with OnHammerHit, using hitentity as the target.
    First attempt use to look like this:

    Code:
            void OnHammerHit(BasePlayer player, HitInfo info)
            {
                if(info.HitEntity == null)
                {
                    PrintWarning("No entity found");
                    return;
                }
                var playercol = player.GetComponent<Collider>();
                if(playercol == null)
                {
                    PrintWarning("Player dosn't have collider!");
                    return;
                }
               
               var entitycol= info.HitEntity.GetComponent<Collider>();
                if(playercol == null)
                {
                    PrintWarning("Entitydosn't have collider!");
                    return;
                }
                Physics.IgnoreCollision(playercol, entitycol, true);
                PrintWarning("Done!");
            }
    Aaaand... didn't work out. As I sai above - some items doesn't have Collider at all. Workbench, for example.
    But even if the item has collider - that does nothing. So in my mind if I hit a chair with hammer - I'm able to walk thro it. But nope - i can't.
    Another idea was almost the same, but getting all collider in child of entity:

    Code:
            void OnHammerHit(BasePlayer player, HitInfo info)
            {
                if(info.HitEntity == null)
                {
                    PrintWarning("No entity found");
                    return;
                }
                var playercol = player.GetComponent<Collider>();
                if(playercol == null)
                {
                    PrintWarning("Player dosn't have collider!");
                    return;
                }
                var cols = info.HitEntity.GetComponentsInChildren<Collider>();
                PrintWarning($"Entity has {cols.Count()} colliders: {string.Join("\n", cols.Select(p => p.name).ToArray())}");
                foreach(var col in cols)
                {
                    Physics.IgnoreCollision(col, playercol, true);
                }
                PrintWarning("Done!");
            }
    Still doesn't work. Even setting entity colliders IsTrigger to true does absolutly nothing....
    Any ideas would be really appriciated!
     
  2. I've played around with this same idea before - I concluded at the time that it isn't possible. From what I had seen, I determined that at least part of the collision handling is done on the client-side. You could possibly disable networking between the entities, thus "hiding" it from your client, but then you'd not be able to see whatever it is you're walking through... but this is theoretical - I haven't tested it at all...
     
  3. Most things use RigidBodies, maybe try playing around with those instead.
     
  4. Try doing something like this to get the collider, seems to work (at least on some things?) for me:
    Code:
    entity.transform.GetComponentInChildrenIncludeDisabled<Collider>()
    
    EDIT: Also, on any entity of type BaseCombatEntity you can use _collider which seems to work when .GetComponent doesn't.
     
  5. Thanks for all your replies. Gonna try both - from rigitbodies and _collider (No, really, there is a var for this? o_O didn't notice) and let you guys know.
    @ignignokt84, I think you are right, but there must be a way to send the info to the client..... I'll post here if I'll find the solution.
    [DOUBLEPOST=1507542095][/DOUBLEPOST]
    Also - I was unable to make RigidBodiy work... for some reason ApplyForce, for example give me error....
     
  6. So far - this way of getting collider seems to be working:

    Code:
                Collider entitycol = null;
                if(entity is BaseCombatEntity)
                {
                    PrintWarning("First way");
                    entitycol = ((BaseCombatEntity)entity)._collider;
                }
                if(entitycol == null)
                {
                    PrintWarning("Second way");
                    entitycol = entity.transform.GetComponentInChildrenIncludeDisabled<Collider>();
                }
    But what now? This code:

    Code:
                Physics.IgnoreCollision(playercol, entitycol, true);
                player.SendNetworkUpdateImmediate();
                entity.SendNetworkUpdateImmediate();
    Still doesn't work....
     
  7. Sup? No one has an idea?
    I'm gonna look thro the client assembly, maybe I'll found something there. Will post here if there would be anything usefull.
     
  8. Did you find a solution?
    I have the same problem.
     
  9. Still nothing. No idea how this can be realized. Looks like the info about removing collision is not being send to the player, and I'm out of ideas right now. ALso don't have enought time, so...
    Not yet =(
     
  10. what did you have for RigidBodiy