Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to swap out prefabs or game objects?

Discussion in 'Scripting' started by SuperCrow2, Jul 6, 2023.

  1. SuperCrow2

    SuperCrow2

    Joined:
    Mar 8, 2018
    Posts:
    584
    At least I think thats how it should be done.

    I have a teleporter and kept it simple right now. Its represented by a blue rectangle that I drew in a different art program. That blue rectangle represents when the teleporter is active, but I want to change it to a dark blue rectangle (will draw that too) when it becomes inactive which is after the player character uses it once.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,756
    Put two of them, one dark, one light (or whatever), then disable one or the other appropriately.
     
  3. SuperCrow2

    SuperCrow2

    Joined:
    Mar 8, 2018
    Posts:
    584
    Oh or that lol.

    Thanks. Thats easy enough for me to do.

    Never thought of that.