I’ve got my character grounded properly, but I don’t want him considering standing on top of another person as ground. It’s hard to explain, but basically, the character flies. So when he stops flying, he’ll float down to the ground. My problem is that if he were fighting mid-air and accidentally collided above an enemy, he would act as if that enemy is the ground, and ground himself, thus stopping him from flying.
What I want him to do in that situation is to not consider that person as ground, and simply continue flying. So I essentially want to limit what the character see’s as being “grounded” to a selected layer mask. If anybody got through my mess of an explanation, here’s what I’m working with:
//Apply gravity
moveDirection.y -= gravity * Time.deltaTime;
//Move controller
var controller:CharacterController = GetComponent(CharacterController);
var flags = controller.Move(moveDirection * Time.deltaTime);
grounded = (flags & CollisionFlags.Below) != 0;
//^Here would be the “grounded only if colliding with layer X snippet”
Any help is greatly appreciated as always.