unity c# change color of gameobject
C#
using UnityEngine;
using System.Collections;
public class collisionpill : MonoBehaviour
{
public Color mycolor;
void OnCollisionEnter(Collision other)
{
if (other.transform.tag == "Pill")
{
gameObject.GetComponent<Renderer>().material.color = mycolor;
}
}
}
Also in C#:
- Title
- c# return two variables of different types
- Category
- C#
- Title
- format string to date only c#
- Category
- C#
- Title
- c# list to string join
- Category
- C#
- Title
- movement script c#
- Category
- C#
- Title
- C# .net core convert string to enum
- Category
- C#
- Title
- while loop c#
- Category
- C#
- Title
- convert word files to plain text c#
- Category
- C#
- Title
- try catch c#
- Category
- C#
- Title
- choose random gameobject from a gameobject list
- Category
- C#
- Title
- how to chagne rotation in unity
- Category
- C#
- Title
- c# convert double to int
- Category
- C#
- Title
- unity delete specific text in a string
- Category
- C#
- Title
- __dopostback
- Category
- C#
- Title
- set width of rect transform unity
- Category
- C#
- Title
- c# get last character of string
- Category
- C#
- Title
- c# one line set
- Category
- C#
- Title
- how to stop window from terminating c# visual studio
- Category
- C#
- Title
- length of a string c#
- Category
- C#
- Title
- C# save pdf stream to file
- Category
- C#
- Title
- find month number from date C#
- Category
- C#
- Title
- functions unity
- Category
- C#
- Title
- multidimensional meaning
- Category
- C#
- Title
- exit game unity
- Category
- C#
- Title
- check if number is even or odd c#
- Category
- C#
- Title
- how to get length of okobjectresult c#
- Category
- C#
- Title
- c# array Reverse method
- Category
- C#
- Title
- how to change scenes in unity
- Category
- C#
- Title
- how to parse a string to an integer c#
- Category
- C#
- Title
- use enter key unity
- Category
- C#
- Title
- unity 2d rotate towards direction
- Category
- C#
- Title
- What is a class in c#
- Category
- C#
- Title
- convert from xls to xlsx C#
- Category
- C#
- Title
- set object to random color unity
- Category
- C#
- Title
- list c#
- Category
- C#
- Title
- bold caption latex
- Category
- C#
- Title
- .net core cli
- Category
- C#
- Title
- how to find object by ag unity
- Category
- C#
- Title
- c# get list of all class fields
- Category
- C#
- Title
- find gameobject with tag
- Category
- C#
- Title
- snake game
- Category
- C#
- Title
- c# string to lowercase
- Category
- C#
- Title
- c# check to see if dictionary key exists
- Category
- C#
- Title
- how to detected WindowCloseEvent in other window wpf
- Category
- C#
- Title
- c# declare an int list
- Category
- C#
- Title
- how to get the askii code of a char in c#
- Category
- C#
- Title
- compile in one single exe c#
- Category
- C#
- Title
- c# catch two exceptions in one block
- Category
- C#
- Title
- c# get time
- Category
- C#
- Title
- c# 2 timespan return yesterday
- Category
- C#
- Title
- c sharp split string
- Category
- C#
- Title
- c# get all inherited classes of a class
- Category
- C#
- Title
- unity docs player input
- Category
- C#
- Title
- c# remove spaces from string
- Category
- C#
- Title
- chase object unity
- Category
- C#
- Title
- background color with opacity
- Category
- C#
- Title
- .net identity seed users and roles
- Category
- C#
- Title
- what is a return statement C#
- Category
- C#
- Title
- c# get pc ip address
- Category
- C#
- Title
- unity particle system color
- Category
- C#
- Title
- string to uint c#
- Category
- C#
- Title
- parsing string to int c#
- Category
- C#
- Title
- csharp check if env is development
- Category
- C#
- Title
- the name scripts does not exist in the current context mvc 5
- Category
- C#
- Title
- index in foreach c#
- Category
- C#
- Title
- unity how to change rotation
- Category
- C#
- Title
- check if network is available c#
- Category
- C#
- Title
- c# nullable generic
- Category
- C#
- Title
- unity hide mouse first person
- Category
- C#
- Title
- ping with c#
- Category
- C#
- Title
- bytes size c#
- Category
- C#
- Title
- c# timespan
- Category
- C#
- Title
- how to trim path in C#
- Category
- C#
- Title
- stop ui from clipping wall
- Category
- C#
- Title
- c# md5 string
- Category
- C#
- Title
- if a method doesnt rutern a value, what shouyld i reeturn c#
- Category
- C#
- Title
- for each property in object c#
- Category
- C#
- Title
- unity create gameobject
- Category
- C#
- Title
- built in methods to order a list c#
- Category
- C#
- Title
- unity 2d top down movement
- Category
- C#
- Title
- c# get country code
- Category
- C#
- Title
- unity simple fps controller
- Category
- C#
- Title
- asp.net render control to string
- Category
- C#
- Title
- verifyusertokenasync password reset token
- Category
- C#
- Title
- count the number of notes in a given amount c#
- Category
- C#
- Title
- how to get array of children transform
- Category
- C#
- Title
- how to set a gizmo color unity
- Category
- C#
- Title
- order by C#
- Category
- C#
- Title
- how to add to a list c#
- Category
- C#
- Title
- ASP select box all states
- Category
- C#
- Title
- go right unity
- Category
- C#
- Title
- x angle oes back after 90 unity
- Category
- C#
- Title
- c# remove time in datetime
- Category
- C#
- Title
- convert string to decimal c#
- Category
- C#
- Title
- c# skip following code in loop
- Category
- C#
- Title
- sending data photon c#
- Category
- C#
- Title
- create line in unity
- Category
- C#
- Title
- unity movetowards 2d
- Category
- C#
- Title
- unity hide mouse
- Category
- C#
- Title
- how to make % posibility to spawn an object C# in unity
- Category
- C#
- Title
- c# random number between 0 and 1
- Category
- C#