I’m working on a 3rd person shooter
currently working on camera collision detection
I began by doing raycasts from the main cam to 4 locations and if any of the 4 came back with a hit lerping the camera forward until the raycasts came back clean
(my 4 points were just left of the player, and a mirrored point on the right of center, one in center, and one above center, basically ensuring that the core gameplay area from around players waist to just over his head was always clear)
i began this process and while I’m 100% that this will work i thought that’s a lot of raycasts to be doing all the time, so i wanted to trim it back some, my solution was to put a collider between the camera and player essentially covering the same area, making the collider a trigger, and then running the raycasts only when the collider was being triggered. I thought this would be a pretty simple process, but for some reason my collider doesnt seem to want to trigger
in a little demo level i put up a couple walls, a tree and some cubes and ran around, nothing was triggering the trigger event for the collider, then I took one of the cubes and set it to continuous detection and it worked… so the code works, but for some reason it is only recognizing the ontriggerenter when continuous collision detection is set, and since I dont not want to set every object in every level to continuous detection this isnt much of an option
has anyone ran into this before, or does anyone have any ideas why discrete detection will not work but continuous will?
on a whim i tried changing the event to ontriggerstay and oncollisionenter and they didnt seem to make any difference.
Thanks ahead of time for any input.