Koning Julien 0 Posted June 15 Hi all, I'm trying to activate a layer through script. The layer is called "Layer2" in the editor and has Activation Type "ON_TRIGGER_ACTIVATION". I have a trigger that has an "OnActivate" script. In this script I would like to tell the game to activate "Layer2" (and subsequently all entities below it). I currently have this code: class Trigger1_Class: SCR_FactionControlTriggerEntity { override void OnActivate(IEntity ent) { SCR_HintManagerComponent.GetInstance().ShowCustomHint("Trigger fired", "Success", 15); //The hint pops up when the trigger fired, which proves the trigger is set up correctly IEntity nextLayer = GetGame().GetWorld().FindEntityByName("Layer2"); //The script gets Layer2; but now how do I activate it? } }; Any help is greatly appreciated! Share this post Link to post Share on other sites
jamesleboulanger 0 Posted June 22 Do you have any update on this ? I tried too but I did not find any solution. Here is my guess : GenericEntity targetEntity = GenericEntity.Cast(GetGame().GetWorld().FindEntityByName("Layer1")); targetEntity.Activate(); But it's not working. Share this post Link to post Share on other sites
Depechivo 0 Posted August 20 Try to use flags. targetEntity.SetFlags(EntityFlags.ACTIVE, false); Share this post Link to post Share on other sites