- Home /
Question by
Chazzwazzler · Dec 13, 2019 at 04:12 AM ·
tilemaptiles
Tiles with their own scripts
I am making it so that in my game you can place down tiles, and I want to to be able to change the color of the tile that you are going to place with rgb sliders. To do this I want to make it so that when each tile spawns they each are the color that the rgb sliders were set at when the tile was placed. How do I do something like this?
Comment
Best Answer
Answer by goutham12 · Dec 13, 2019 at 02:01 PM
private void ChangeMaterial(GameObject target,Color _color)
{
Material mat = new Material(Shader.Find("Specular"));
mat.color = _color;
target.GetComponent<MeshRenderer>().material = mat;
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612220108im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can isometric tiles be rotated? 0 Answers
Player sticks to right side of platform after jumping in it 1 Answer
Is it possible to create a GameObject from a set of tiles? (2D) 0 Answers
Collision/scripting for tiles 0 Answers
How do you get the tile on which a gameObject is standing on Isometric Tilemap ? 1 Answer