Change color of a game object when clicking on it![unity 5]

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024

Комментарии • 45

  • @foodtheedible
    @foodtheedible 7 лет назад +11

    NOT WHAT I WANT i wanted to change the actual color of an object

  • @MavsFit
    @MavsFit 8 лет назад +1

    How do if I touch screen the gameobject change color?

  • @nasrullahubaid9184
    @nasrullahubaid9184 5 лет назад +1

    it works thanks man.. but i have aquestion, i have to rend more than 1 object with the same button.. how???
    please help me

    • @zakalberda6618
      @zakalberda6618  5 лет назад

      Change bother objects when button is pressed? You would put your code in the listener for both objects. Does that make sense to you?

  • @Glenos92
    @Glenos92 2 года назад

    Thanks for this tutorial dude!! I'm using it as part of my university weekly project. Really saved my skin! Yours was the best that I found after 4hrs of trial an error of other tutorials that don't provide the same results. :D

  • @HarryIsAwesome18
    @HarryIsAwesome18 4 года назад

    Does this script for the children of a particular prefab?

  • @owohater1375
    @owohater1375 4 года назад

    what if you had 2 materials

  • @ColdmindDev
    @ColdmindDev 7 лет назад

    What the hell? this is terrible!! and kid what´s up with the Clint Eastwood mimic?..

  • @ondrejkover3094
    @ondrejkover3094 6 лет назад

    how to change the color of the cylinder but by clicking on the sphere? how do you do that. Adding just cylinder in Render colum doesn't work. Thanks for help

  • @hysteriaadvertising4517
    @hysteriaadvertising4517 5 лет назад

    i want to show a panel of colors when the game object selected ???!

  • @SolaresterMMORPG
    @SolaresterMMORPG 4 года назад

    Thank u

  • @emjaceltv6541
    @emjaceltv6541 6 лет назад

    sir can you make a tutorial that the player just pass through if the obstacle have same color with the player and the game will over if the player hit different from it color.
    ? please sir

  • @jorgesalamanca3170
    @jorgesalamanca3170 8 лет назад

    hello, i have a problem :/
    rend.sharedMaterials = materials[index-1];
    cannot implicity convert type ''UnityEngine.Material' to 'UnityEngine.Material[]'
    Thanks you

    • @Lordjesus93
      @Lordjesus93 8 лет назад +1

      is material, no materials

  • @catherinecitta2974
    @catherinecitta2974 3 года назад

    Thank you so much!!

  • @Audiotorium87
    @Audiotorium87 6 лет назад

    How do i add my oculus touch controller? Thank you

  • @ilonpilaaja
    @ilonpilaaja 7 лет назад

    Why even siple color chance have to so hardly

  • @christopherdicdican8098
    @christopherdicdican8098 8 лет назад

    what if you want to change the color of the cylinder but instead clicking on the sphere? how do you do that. (for project purposes. :D)

    • @zakalberda6618
      @zakalberda6618  8 лет назад

      +Christopher Dicdican I wish I had more time to help you I'm busy right now between work and school to do anything. I think all you would have to do is switch which object is being changed when you click on it. I know probably doesn't help much without the code to go along with the explanation but I know you can figure it out.

  • @wentghu137
    @wentghu137 4 года назад

    Bester Mann

  • @sanketnerkar4284
    @sanketnerkar4284 7 лет назад

    thank you sooooo much it is really helpful for me

  • @suenzhong7891
    @suenzhong7891 6 лет назад

    Thanks mate! This was a lot of help.

  • @harrisonbibb1931
    @harrisonbibb1931 7 лет назад

    love it. keep up the good work

  • @onezafran
    @onezafran 6 лет назад

    how i can change to colour according to time?

  • @mcdonaldmilkshake5226
    @mcdonaldmilkshake5226 8 лет назад

    but what if you want to hit a key on your keyboard to change the color?

    • @zakalberda6618
      @zakalberda6618  8 лет назад

      +EmeraldMadness you may have to create a new method that allows that. If I have time I'll try and help you out. Got to study for a chemistry exam! Take it easy.

    • @greencrystals9022
      @greencrystals9022 3 года назад

      instead of MouseButtonDown use GetKeyDown google GetKeyDown to learn it better cause i cant explain it here

  • @pakoalvarez4332
    @pakoalvarez4332 6 лет назад

    un rap de league of legends porfavor :D

  • @haithameyani2036
    @haithameyani2036 7 лет назад

    I need your script
    the one I got from the link dose not work

    • @zakalberda6618
      @zakalberda6618  7 лет назад

      Ok thank you for your comment, I will make a link to the script today. I'll send you a private message when it's done.

    • @zakalberda6618
      @zakalberda6618  7 лет назад +2

      zakalberda.wordpress.com/2017/03/03/change-color-of-a-game-object-when-clicking-on-it-source-code/

    • @haithameyani2036
      @haithameyani2036 7 лет назад

      thank you
      .
      hope the best for you

  • @naufalbayu5486
    @naufalbayu5486 8 лет назад +1

    what if i want to change game object color with button? my idea is like when you want to buy something, and you can pick any color that available. Thanks before :)

    • @zakalberda6618
      @zakalberda6618  7 лет назад

      ruclips.net/video/y2JwMb4WZeQ/видео.html Here ya go buddy

  • @leotakerkane
    @leotakerkane 7 лет назад

    how to do this using a ui button??

    • @zakalberda6618
      @zakalberda6618  7 лет назад

      +Leo Jocker I'll look into it.

    • @zakalberda6618
      @zakalberda6618  7 лет назад

      ruclips.net/video/y2JwMb4WZeQ/видео.html Here ya go buddy

  • @Lordjesus93
    @Lordjesus93 8 лет назад

    thanks :)

  • @maithreyajs884
    @maithreyajs884 7 лет назад

    This is wonderful!!! Thank you so much. You are doing a great job. Now what if I have 5 spheres ( any game objects) which are named for example A,B,C,D and E. I need an input option somewhere such that if I input the name; say C, the corresponding sphere gets highlighted (changes color). Kindly help me with this.. Thank you...:)