Hey, I am working on a system that requires a few things of the player collisions: I need to reduce the cost of player’s collisions, I need to be able to simulate multiple ticks of player movement at once, and I need to have the player’s collision box aligned to an axis permanently to allow them to slide against walls while airborne (using my custom movement logic) which is normally very awkward due to player animations collision and rotation pushing them away from the wall.
These requirements have lead me to understand that I need an AABB that works much like the one mentioned here: Bounding Box - Valve Developer Community. Using this as a guide I have a sort of solution working here where:
- The AABB is a part that I can copy and resize as I wish. It is aligned to an axis using an AlignOrientation and the player is stripped of their own collisions and all states are disabled before cframing the root part to the center of the AABB.
- Even though the AlignOrientation is set to rigid, I have not been able to confirm whether or not it is actually perfectly reliable. Also, as I understand it, this constraint makes physics more costly on the part.
- The box has to project a lot of rays downward to detect if the player is standing on a surface. Which is costly and still less reliable than being able to feel along the box’s bottom face.
- Integrating the ability to climb up stairs is very challenging on this system as I have no real control over the way collisions are resolved. Casting rays in all directions on every frame is not an exciting solution.
- I have to use a BodyForce to counteract the workspace gravity in order to code my own which is costly and makes the system less reliable.
- I cannot simulate multiple steps of the physics simulation on this part at a time.
So there are a few issues with this system. I am looking for the best way to improve my system. I do not want to have to rely on a part to represent my AABB. My AABB does not need to affect other objects, it only needs to be able to collide with static walls. My AABB also needs to work with any of the geometry roblox could throw at me. In my research through some ~5 year old posts it looks as though making use of a region3 and the separating axis theorem would be my best bet. However these resources are pretty old and I can’t find any solid evidence of a good result using this. So with this post looking to find if modern Roblox offers any other methods. I am unsure if writing my own collisions would really yield the results I am looking for, as well as being very time consuming for someone working on a deadline.
Should I just commit to the region3 + SAT method or is there anything more straightforward for Roblox?