a
Well, you could do something like this:
boolean set to false by default
ontriggerenter sets it to true
in your coroutine:
yield return new WaitUntil ( () => didTriggerEnter);
@Volks42 , since OnTriggerEnter is an Event callback I would recommend that you use it to set a boolean flag variable from false to true. In FixedUpdate test the boolean and if it is true then do whatever needs to be done. The following needs to be in a class that inherits from MonoBehaviour.
bool triggerHit;
void Awake()
{
triggerHit = false;
}
public void OnTriggerEnter(Collider myCollider)
{
triggerHit = true;
}
void FixedUpdate()
{
.
.
.
if(triggerHit)
{
// do whatever here...
triggerHit = false;
}
}