• ShouldCollide and Bullets...
    3 replies, posted
Bullets are treated as players in ShouldCollide. That's not good at all. It means players of a team allowed to go through a forcefield, can shoot through that forcefield, while the ones on the other team can't. How can I make it so all bullets pass through something but nohing else does? Also, on the client, despite having the ShouldCollide function shared, bullets appear to "hit" the forcefield, regardless of whether they actually pass or not. How can I fix this as well?
[img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/EntityFireBullets]GM:EntityFireBullets[/url] ShouldCollide essentially tells the client and server to ignore interaction between the two entities. Bullets are not physical entities, but rather traces which come from a player. Since the player and the server are told to ignore that entity's collisions, the trace goes through. So with this hook, you should do: Check what entity the bullet hit Is it our forcefield? If yes, suppress the bullet, create a new bullet with the same information, and place it on the opposite side of the forcefield. If no, do nothing.
What about the "[clientside] bullets appear to hit the forcefield, regardless of whether they actually pass or not" issue?
[QUOTE=RonanZer0;50530879]What about the "[clientside] bullets appear to hit the forcefield, regardless of whether they actually pass or not" issue?[/QUOTE] It's a shared hook.
Sorry, you need to Log In to post a reply to this thread.