The code after yield waitForSeconds doesnt run in a C# coroutine
This may may occurs when the Unity Playworks Plugin engine transpiles C# to javascript.
Consider the following C# code:
This will translate to return true
in JavaScript which will exit the function rather than continue it.
Possible solution:
- Remove the yield statement if possible. Or use the Unity Invoke function.
Example:
void Start()
{
Invoke("LaunchProjectile", 2.0f);
}
void LaunchProjectile()
{
Rigidbody instance = Instantiate(projectile);
instance.velocity = Random.insideUnitSphere * 5.0f;
}