![]() This means the previous code would've worked if that had been done, but the gameobject code is much better for me because the blackout layer is one that I need to be OFF all the time.īasically, my old code works! Just move the if statement before the "getcomponent.enabled = false" because the script is read in order. It should have been before the code that makes the sprite false. Here's the full new code: using System.Collections ĮDIT: One more thing to note! The location of the if statement WAS important. &0183 &32 To add a conditional class in Angular we can pass an object to ngClass where key is the class name and value is condition i.e. ![]() ![]() It works perfectly! I changed the reference type to gameobject and reaasigned it and made the necessary and it works like a charm now! Prodian asked if I tried gameobject.activeself, and I want to thank you for the advice. When enabled, I want the last bit of code to run but it won't. The public blackout has a sprite renderer that is disabled. Private void OnTriggerEnter2D(Collider2D other)Ĭhargesprite.GetComponent().enabled = false Ĭollision.GetComponent().enabled = false the conditions of the leverage framework to offset derivative assets. Public class PickUpReCharge : MonoBehaviour Prudently valued software assets, the value of which is not materially affected by. Here's the code I tried: using System.Collections ![]() I'm trying to have an if condition to do something if the sprite renderer of another object is enabled, but it won't work. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |