This is easily the best video I've seen on this so far.
@aboutgamemaking2 жыл бұрын
I am so happy that the tutorial really helped you. Thank you for watching! :)
@twosoulfox Жыл бұрын
Your topics and concepts are interesting. Also your older animations and ideas. I hope you can work in a good environment. Kind regards.
@aboutgamemaking Жыл бұрын
Thank you ! I will keep it up. :)
@ShatabdaRoy1152 жыл бұрын
I am quite surprised how this tutorial is rich with info... Like no joke
@aboutgamemaking2 жыл бұрын
I really thank you!! ,,ㅎㅅㅎ,,
@ShatabdaRoy1152 жыл бұрын
@@aboutgamemaking whats ur discord mate?
@aboutgamemaking2 жыл бұрын
@@ShatabdaRoy115 Sorry, I don't use Discord. :(
@ShatabdaRoy1152 жыл бұрын
@@aboutgamemaking np I wish our path meet us again ;)
@aboutgamemaking2 жыл бұрын
@@ShatabdaRoy115 Sure thing. I will get the Discord account when the company's work is done.
@DatCameraMON2 жыл бұрын
What if you aren't using a Standard material and are using a URP material?
@aboutgamemaking2 жыл бұрын
Do you mean modifying material properties in URP shader? It is same as the tutorial video. As you can see the tutorial, I accessed properties' names and changed their values. Therefore, there are no differences in between standard and urp shaders.
@DatCameraMON2 жыл бұрын
@@aboutgamemaking Nevermind, I figured it out. You have to use: (lead up stuff).material.SetTexture("_BaseMap", (textureName)); to switch it for URP materials, I believe. In my case, I also was messing up which Renderer was assigned. I forgot that my character had a Skinned Mesh Renderer attached to the body, which was under the Player object and what I needed to assign as the Renderer variable.
@deicide23243 жыл бұрын
Hi, what if I wanna to disable or enable all the materials in the model by click a button?
@aboutgamemaking3 жыл бұрын
Do you mean remove the texture?
@deicide23243 жыл бұрын
@@aboutgamemaking I don't think so? I am a new for unity and the model's material is applied color from Blender.
@aboutgamemaking3 жыл бұрын
@@deicide2324 Ok, What you have do is, you better know what do you want to express exactly in your game. Let say about the 'Example'. Hope you understand what I'm sayng. :) Could you explain about your example?
@deicide23243 жыл бұрын
@@aboutgamemaking Actually this is my final year project, the model consists of more than 1000 "parts" and each part has more than 1 color. What I want to do is to change all of colors in the parts to "white".
@aboutgamemaking3 жыл бұрын
@@deicide2324 Alright, There many ways to change color. 1st one is change shader's property, for instance "_MainColor" or "_Color". If you use Unity's standard shader or built in shader, you can access one of shader's properties called "_MainColor". The second one is also access Standard shader's Emission and change its color. The 3rd one is change the Texture, but it might causes lots of CPU or GPU usage. In Summery, I recommend access the object's materials and shader's properties. So, you might access objects' 'Renderer' and access Renderer's Material. Actually, I'm telling you about the tutorial's content. :)
@Cherry_Dev2 жыл бұрын
Where i can download the script?
@maitrykotak3703 Жыл бұрын
is there any helpful video for changing object like on button click new gun model come in unity..please refer
@aboutgamemaking Жыл бұрын
Check the tutorial down below : kzbin.info/www/bejne/fH-yaGiwbt2BZ6s
@fariahuq64733 жыл бұрын
Hi! Thanks for this great tutorial! One of the best for Shader manipulation via scripting. Can you kindly tell me what is the difference between renderer.material and renderer.sharedmaterial? I sometimes encountered that renderer.material does not work correctly but renderer.sharedmaterial does.
@aboutgamemaking3 жыл бұрын
1. Changing properties with 'SharedMaterial' persists the changed properties even after gameplay stops. 2. On the other hand, if you stop the game after changing the properties of a shader or material with the 'Material' command, it will return to its original state. When rendering objects, the 'SharedMaterial' of the Renderer component is used by default, but a copy of the SharedMaterial is created when using the 'Material' command. You'll have to test it out to understand this. Try creating a runtime script for two objects that use the same material, changing one to blue and the other to red. If you have tested and verified the above, it will be easier to understand. ,,ㅎㅅㅎ,,
@fariahuq64733 жыл бұрын
That makes so much sense! Thanks a lot again for the detailed answer. Would love to see more of your great resources on texture and material manipulating via script 😄
@Krazion6693 жыл бұрын
Thank you for the tutorial, it was very helpful. If an object has multiple materials, how would I select which material to change? For example, my object has pupils, cornea, and irises as materials. When I click the button to change materials, it changes the pupils (which is the first material). How could I change the script to change the irises material?
@aboutgamemaking3 жыл бұрын
Before I help you, I have a question. If you have multiple materials applied to your character's eyes, are the pupil, cornea, and iris as separate GameObjects?
@Krazion6693 жыл бұрын
@@aboutgamemaking No, the materials are all part of the same game object.
@aboutgamemaking3 жыл бұрын
@@Krazion669 OK, applying multiple material means the material component supports array variables. Therefore, you need Renderer variable with Array, like this : Renderer[] rend; After get Renderer compornent, you will be able to access each renderer with index number, like : rend[0].material.( certain elements from material) ; or you have to test it via debug : Debug.log (rend[0].material. [ ] ); Try it and give me the result. :)
@SceneOfAction Жыл бұрын
What a great tutorial! I tried the method you replied with for multiple mats on one object but it didn't work so I tried this and it DID! The array is already built in if you have multiple materials on one object so this line worked without changing anything else. Just add an s to material (because it's plural if there is more than one material on the object), then set the number in the material array you want to change: _renderer.materials[2].SetTexture("_MainTex", newTex); Thanks for the great tutorial!
@MayKayy10 ай бұрын
You are the best!
@eyestorm32893 жыл бұрын
awesome video, thank you very much
@WerIstWieJesus2 жыл бұрын
More videos about Unity "in script" please!!!
@aboutgamemaking2 жыл бұрын
I will try. ㅠㅅㅠ (crying)
@WerIstWieJesus2 жыл бұрын
@@aboutgamemaking I whish you the best.
@aboutgamemaking2 жыл бұрын
@@WerIstWieJesus Thank you!
@smorazzi7494Ай бұрын
How can i change emission intensity via script? I can't find it. Usefull video! I hope u can upload more videos as this! Thank you!
@aboutgamemakingАй бұрын
Emission, or the intensity of luminescence, is controlled by the brightness of the color. However, it would be possible to control only the intensity while maintaining a specific Emission color at runtime, but it would be a very cumbersome process. A realistic way would seem to be to create a custom shader. I will consider creating a tutorial on this issue in the future.
@StickyLabDev Жыл бұрын
now iknow ,hope i can , _BaseMap cause i used render peplain yeah wakwak
@mandrake10173 жыл бұрын
Muchas gracias!!
@aboutgamemaking3 жыл бұрын
¡Eres bienvenido! ¡Muchas gracias por ver mi video!