Question by
RohnekKdosi · Jan 16, 2018 at 06:21 PM ·
c#texture2dcollider2dfunctions
How to change/disable/enable things like textures/hitboxes etc. in game
Hi, I (and a friend) are working on a game (2D). Not gonna tell much about it, 'cause spoilers, but I need to know, how do we change textures, disable/enable coliders, etc. while the game is running? Is there a function for it? I'm using C#.
Comment
Textures are typically attached to some renderer. Hitboxes are typically made using colliders. In both cases, you would change the enabled field of the Component. Since you sound new to Unity, you may want to watch a tutorial on the process.
Your answer