So im pretty new to unity and for seem reason I can’t get this pickup script to work. Im trying to make it so that when the player collides with a torch asset within the world the world object disappears and an inactive object positioned in front of the camera is activated, creating the illusion the character has picked up the torch. The world torch disappears but the camera torch doesn’t activate can anyone tell me why? The collider works fine also so im really sure what this issue is:
void OnControllerColliderHit(ControllerColliderHit hit)
{
if (hit.gameObject.name == "worldTorch")
{
Debug.Log("Object picked up " + hit.gameObject.name);
Destroy(hit.gameObject);
Torch.SetActive(true);
}
}
so the “Torch” is the one in front of the player and worldTorch is the one in the world with the collider etc
Thanks