Hello; I’m trying to do this tutorial but there’s an error. I seem to have misplaced a curly brace.
{
public class Trigger : AsyncScript
{
// Declared public member fields and properties will show in the game studio
public override async Task Execute()
{
var trigger = Entity.Get<PhysicsComponent>();
trigger.ProcessCollisions = true;
{
while(Game.IsRunning)
{
// Wait for an entity to collide with the trigger
var firstCollision = await trigger.NewCollision();
var otherCollider = trigger == firstCollision.ColliderA
? firstCollision.ColliderB
: firstCollision.ColliderA;
otherCollider.Entity.Transform.Scale = new Vector3(2.0f, 2.0f, 2.0f);
// Wait for the entity to exit the trigger
Collision collision;
do
{
collision = await trigger.CollisionEnded();
}
while (collision != firstCollision);
otherCollider.Entity.Transform.Scale = new Vector3(1.0f, 1.0f, 1.0f);
}
}
}
}