Product Chat (Early Access) / Do collision boxes also determine hitscanning & AI line-of-sight?

Author
Message
Kraven W
Valued Member
5
Years of Service
User Offline
Joined: 28th Dec 2018
Location: United States
Posted: 8th Jun 2022 17:53
Let's say I have a very large wall with a highly complex mesh that has several holes in it. The player is not intended to be able to go through these holes, and I want to save on performance, so I give my wall simple box collision.

My question is, will the player/AI still be able to "shoot" through all of these holes in the wall if the entire wall has a simple box collider around it? And also, can the AI "see" through these collision shapes? As in, being able to see the player through these holes in the wall if a collider covers them?

Was going to try to ask on stream today since I'm off work, but I think my question is too long for Lee to read it. May try it anyway, though!
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 8th Jun 2022 20:37 Edited at: 8th Jun 2022 20:39
i believe the default system uses meshes as obstacles so it should be fine for firing through and raycasting - though easiest way to say for sure is to test it
edit: did a quick test with a door frame and setting it to box collision means i can't walk through it but i can shoot enemies through it so you should be fine
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Kraven W
Valued Member
5
Years of Service
User Offline
Joined: 28th Dec 2018
Location: United States
Posted: 9th Jun 2022 02:08
Thanks, @smallg. Will definitely have to play around with some stock assets tomorrow to make sure bullet holes and so on go where they're supposed to. Will be a nice optimization trick if it works the way I'm hoping that it will. And by the sounds of your quick test, I have high hopes

Login to post a reply

Server time is: 2024-05-03 08:41:44
Your offset time is: 2024-05-03 08:41:44