To keep things short, I am new to coding and Unity in general.
I tried to find good tutorials, but none of them helped me out. I am currently making a “Gorilla Tag” fangame and need some assistance on changing the player’s color. I want there to be a button system, where whatever button you press, that is the color you have. Here is the code I have that doesn’t seem to want to work.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ColorChange : MonoBehaviour
{
public Material m_Material;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
void onCollisionEnter()
{
m_Material.color = Color.blue;
}
}
}
Here is also an image that could possibly help.
,Haven’t seen this on a tutorial anywhere, so I’m asking here.
I am making a “Gorilla Tag” fangame in VR. I have used Unity before, but this is my first time coming back to it in a long time. I don’t know how to code well, so that may be part of the problem for I usually use Unreal Engine. How would I make it to where I can press a trigger button and be able to change my player’s material color? Here’s what I am going with so far but it doesn’t seem to work.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ColorChange : MonoBehaviour
{
public Material m_Material;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
void onCollisionEnter()
{
m_Material.color = Color.blue;
}
}
}