(UPDATE: So I got things working for the most part, but I have a new problem.
Basically, I’m using OnTriggerEnter() on the collider and it’s working 100% properly on game clients. I create the collider, it detects collisions in the Mesh with OnTriggerEnter, and then deletes itself.
But for some reason, on the Server, the collider does not detect collisions unless the target is actually moving.
I’m assuming this is because the OnTriggerEnter function is not being called unless the target has motion, and the Server is only updating position when receiving the positions from the client?
I’m not sure how to work around this. I’ve tried OnTriggerStay but that seems inconsistent as well.
Does anyone know exactly what needs to happen for a collider to be detected in OnTriggerEnter?
Is there any way to manually command a MeshCollider to check for any collisions?
Or any other sort of workaround would be appreciated! )
I’m working on a melee system that has very specific arcs of collision that need to use MeshColliders and I’m running in to a couple issues. (This is for a Multiplayer game incase that matters).
I’m not sure the best method to catch collisions like this? The method I’m attempting is to use OnCollisionStay, and all NPC’s that are inside the collider will get a ray drawn to them to make sure they are in line of sight and if so they will get hit. If it hits something remove the collider at the end of the frame. If it does NOT detect anyone inside the collider then it will delete itself on the 2nd frame.
Problem 1) Using OnCollisionStay simply is not working for me. It’s not catching the CharacterControllers at all. I’m suspecting that maybe this is because I resized the mesh inside of Unity? If that’s not it then I have no idea.
Is OnCollisionStay even the best method to do this? Or should I be doing something else?
If OnCollisionStay is the best, would anyone be so kind as to share the code for detecting a CharacterController inside a MeshCollider?
Problem 2) Even if I set the mesh collider to a Trigger and delete the mesh renderer, the player is colliding with it at certain angles.
Any advice would be greatly appreciated. Thanks!