So… i will admit learning collision compared to unity is quite different.
In unity you just have like “OnTriggerEnter(var)” and it’s easy, one and done.
In flax, it’s more of like an event call than a method call where you have to setup more before hand.
so in flax, in your OnStart method you will need to get the collider. And then add the method, (delegate?, i’m not sure 100% what it’s called here) to it’s event call.
You can have it how you will, but I like to have the collider as a class level variable. So as you see, in the start method I set ‘c’ as the actor casted to the collider since the Actor ‘is’ of type collider as well.
And then also in the start i register a method to it’s TriggerEnter, where as in Unity it’s the OnTriggerEnter. Then in the new method you do what you want. It’s more setup that unity but it works the same.
Collider c;
public override void OnStart()
{
c = Actor as Collider;
c.TriggerEnter += middlePipeHit;
}
private void middlePipeHit(PhysicsColliderActor actor)
{
throw new NotImplementedException();
}
Now, when the trigger enters (and you know it’s the bird), you can do whatever you want with the actor that entered (the bird). Or, if you intend to trigger the scoreUp, you can do that as well.
Now, i’m not entirely sure about what you mean by finding a script in unity. Are you talking about the GameObject.Find… etc?
Something similar >(That i haven’t used)< may be ‘Scene.FindScript()’