I have searched everywhere but I can’t figure out how to enable/disable the Meshrenderer of a child.
I have tried to use gameObject, GameObject (now I’ve used transform instead), but my inexperience and little coding knowledge is letting me down.
Here’s a piece of my code so far that could be relevant, search for void Start:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class CharacterSelect : MonoBehaviour {
bool isSelected = false;
Vector3 targetPos;
Ray ray;
RaycastHit hit;
BunnyAttack bunnyattack;
public float distanceFromTarget;
public List<GameObject> bears;
public Transform selected;
void Start ()
{
selected = transform.Find("Selected");
selected.GetComponent(MeshRenderer).enabled = false;