AiAircraft aircraft = GamePlay.gpActorByName("0:BoB_RAF_F_111Sqn_Early.000") as AiAircraft; if (aircraft != null) { // code }