• Shouldcollide hook isnt working..?
    4 replies, posted
I put this in my init.lua file of my gamemode: [lua]hook.Add("ShouldCollide", "EntityCollideTestCheck", function(ent1, ent2) return false end)[/lua] But everything still has collisions. What's going on?
Try this instead [lua] function GM:ShouldCollide( Ent1, Ent2 ) return false end [/lua]
[QUOTE=Dreken;40857402]I put this in my init.lua file of my gamemode: [lua]hook.Add("ShouldCollide", "EntityCollideTestCheck", function(ent1, ent2) return false end)[/lua] But everything still has collisions. What's going on?[/QUOTE] Call this on entities that you want to use in the hook. [code] Entity:SetCustomCollisionCheck(true) [/code]
I tried that, when you do that, it makes that entity not have collisions with anything, including the world. So, if I added this to every prop someone spawns (which is how I tested it), then I'd have to check every prop on the map for collisions and make them collide with world. I don't really know where to go from there.
[QUOTE=Dreken;40862179]I tried that, when you do that, it makes that entity not have collisions with anything, including the world. So, if I added this to every prop someone spawns (which is how I tested it), then I'd have to check every prop on the map for collisions and make them collide with world. I don't really know where to go from there.[/QUOTE] Well, the code you posted for the hook returns false in all cases, so of course they aren't going to collide with anything. The hook is behaving exactly as it should.
Sorry, you need to Log In to post a reply to this thread.