I have a character controller which is running through planes.
Loading 20 planes for my game.
I want to destroy last plane where character controller stands.
Raycast makes high memory
Which is the best method to use this?
I have a character controller which is running through planes.
Loading 20 planes for my game.
I want to destroy last plane where character controller stands.
Raycast makes high memory
Which is the best method to use this?
Use Vector math and trigger events. If the normal of the CC is point in the Z-axis for this example. Then in order to tell if the plane is behind the CC would be for the normal of the plane to be pointing in the opposite direction of the player.
Something like this
Thus we can tell the CC is behind in plane, but we don’t want this for every time the plane is behind the player for no reason. So only check this for the case, the plane leave the collider of the CC. Therefore you could use Unity’s OnTriggerExit function.