How To Change Texture Of 3D Object In Unity Game | Change Material Texture Pressing UI Button Script

preview_player
Показать описание
In this short video I show a simple way how to change texture of 3D object in Unity game. You press or cluck the UI button and a gameobject that has some material attached changes it's texture. Texture is picked randomly from a set of textures. A pretty simple C# script helps us to do it.

That's the gaming mouse!
Logitech G305 LIGHTSPEED Wireless Gaming Mouse

TO BLAST! - My New Fun Relaxing Puzzle Game Available On Google Play Store

If you like what I'm doing then you can support me through
or here
Thank you)

This video is also about: unity change renderer texture, unity change 3d material texture, unity change 3d object texture, unity change texture script, unity change texture of object, unity change cube texture, unity change sphere texture, unity change 3d car texture, unity change material on button click, unity change material texture script, unity3d change texture, unity3d change material texture, unity change texture of object in script, unity texture swap, unity change texture on click, unity change texture of single object, unity change texture of cube script, unity change texture via script, unity change texture of material in script, unity 3d change texture of cube, unity change texture, unity change texture in material, unity texture runtime, unity texture programmatically.
Рекомендации по теме
Комментарии
Автор

Great video thank you.

But what would I need to change in the script to be able to change the material?

GlitchVR
Автор

Super useful like all of your tutorials

theearthburner
Автор

How would you change this script to have it count up instead of being a random selection? Thank you for the great tutorial.

accesssaskatoon
Автор

hahah was thinking "oh what a nice song" and then that text appeared. read me like a book

ParaSMG
Автор

I have a set of images and music i want to change the textures based on the music, any script for it

WhattheAI
Автор

I wonder. I was working on a project that needed me to change the material of an object.
I was trying to fade the material to invisible and my research showed me that the alpha setting of an Opaque Material doesn't work like you think it would. Setting the material to Transparent and then changing the Alpha worked. The only problem was using the material set to Transparent changed other value of the material so it wouldn't work. I think it's lighting was different I forget.

Can a method like this work to swap the material of an object as well?

If not, is it possible to do a video showing how?

THANKS IN ADVANCE Sasha!

NoTimeLeft_
Автор

Nice Video, great content. I have a question if u could help please, how do you save the last used texture so when u press play on unity the last texture is saved and plays from the beginning?

stressfree
Автор

hi please i have problem i want your help please

mr_crapto
Автор

The music made me feel like I was playing some sort of parkour game

sahpdude
Автор

Hello, can you help me, if you have different buttons and you assign each of those to the textures as the code would be, since random does not work for me and I could not do it well. tks

jdgcol
Автор

UK I don't understand the most devs bc I make almost erlvey script shorter and more efficient and then it works

Moonymonk
Автор

Thank you, this video is really helpful.

kevinli
Автор

please give the code everytime i try it gives error

Aguliyev
Автор

Cool tutorial, I was looking for it. But how can I make that's for a lot of cube with diferentes texture for each one?

Themplhe
Автор

fast-forward video + excelent music <3 thank you so much!

CryogenicBanner
Автор

Want different button for different texture

what
Автор

Hi, is there a way to fade between one material and another? I'm a begginer in unity (i'm not a programmer, just a graphic designer), I've been trying with Lerp, but still can't get it to work. Any help is welcome. Thank you for the tutorial!

asbesto
Автор

Really cool stuff! Exactly what I was looking for.

InteractViz
Автор

i can use this for my player customization, thank you!

mikethegamedev
Автор

Hey Can you make serie to make Game look like HOTLINE MIAMI

comikawn