I followed the tutorial and the helicopter is moving fine but It automatically starts playing the sound and moving as soon as the game starts even though my cleararea isn’t clear there is a tree inside the box and also there is water underneath that doesn’t trigger anything because it’s lowered ground not raised.
Hi Brocolli (love the name):
I’m getting the exact same issue. Weird thing is that Ben’s end game state for Zombie Runner does exactly the same thing too. It runs right through the audio, launches a flare, despite there being a tree right behind the player. There’s a problem with the clear area check; just not certain why others haven’t found this same issue and posted it.
If you find a solution, please post it. I’m going to try out the Redesigning the Clear Area suggestion in this post:
Optional Clear Area Code
I have a similar problem with the clear area. For me, the sound doesn’t playing right away, but after moving a bit, even though there are still trees in the collider, it starts playing. There is something not working properly with the OnTriggerStay and the tree colliders. I tried putting a rigid body on the clear area, since according to the docs of OnTriggerStay at least one of the the colliders needs to be a rigid body (and the trees are not), but that did not help.
I’m noticing this as well. For me it seems this only happens when i stop moving at which point OnTriggerStay() doesn’t fire even with terrain inside the collider. After some googling it seems there is a problem with OnTriggerStay in the 5.x versions of Unity, maybe more so with trees and terrain? Some articles led towards rigidbodies and parenting etc. I tried alot of that including some of what mavadnais mentioned like adding a rigidbody to the object and evening attempting to keep it from sleeping. None of that helped me or i didn’t do it correctly.
In the end, this post helped me move on best and has a good explanation:
https://forum.unity.com/threads/ontriggerenter-exit-not-called-for-terrain-trees.449732/
Vedrit says:
"From my experience, trees and grass behave in a rather unintuitive way. They have collision, but it doesn’t interact with triggers. The work-arounds I found for this were:
- Place your own collider at the tree locations. If you are placing trees via scripting, this is easy to automate. Not so much if placing manually.
- Create a prefab of your own that includes colliders. This removes the option of using the terrain tools, but still works with placing trees via scripting, though a different method than from the first option"
Since i painted trees with the terrain tool and there are many of them, adding individual colliders to each tree is unreasonable so an idea i had was to use a few, very large trigger colliders in wooded areas that always seem to collide with my ClearArea collider.
This allows me to remedy the issue and move on.
I’m using version 5.4.3 for this lesson. Not sure if the issue is resolved in higher versions or if even i’m missing something and not seeing the true problem. If anybody has any other ideas or solutions I’d love to hear them.
1st thing: I’m using Unity 2017.1.0p4. That said:
I’m not 100% certain yet, but I THINK I have a possible solution:
Increase the Y size of the Box Collider above the Player such that it holds it’s position (i.e.: click “edit collider and extrude upwards” - I’m using Centre = (0, 14.5, 0), Size = (60, 30, 60)) - basically until it’s almost irresponsibly tall.
My Clear Area Trigger Collider.
Close up of Player juuuuuuuust not contacting trigger.
Falling down even a little bit at spawn seems to help as well (My Player spawns 1 unit off the ground).
These two things together seem to help stop the “Spawn Helicopter Call” (at the very least, I no longer call a helicopter at spawn).
It might be related to the Tree Colliders in the branches, but I’m not sure. Also, the tree prefabs have rigidbodies on their root transform, which apparently causes all child colliders to be non-static (more info in this thread: https://forum.unity.com/threads/solved-rigidbody-also-for-child-colliders.451177/).
If all else fails, make invisible trigger colliders for places you DON’T want the player to call from (e.g. I have a “central island” that has clear space all round it… but it’s absolutely NOT a good space to land. A Capsule Trigger Collider stops the player from abusing the island or its path as a fast extraction method).
This is also a good way of stopping players reaching a high point (like mountains) and winning that way (i.e. Box collider works fantastically in ditches, but not if you’re at a peak).
Hope this helps somehow. I also REALLY hope that someone is able to explain this as well… 
Edit:
Somehow Tree Size seems to matter… Maybe?


