Color myColor = new Color(210f, 2f, 2f, 1f); if(touchingPlatform && renderer.material.color == myColor){ transform.localPosition = startPosition; }