what do i apply this script to (StringTableMgr)

im making a player collide with a car and switch from player to car. like in gta. i got told i need to put a character controller to car and player and add a switching script to it, i googled the scripts name and found this script.

using UnityEngine;
using System.Collections;

public class StringTableMgr : MonoBehaviour
{
public class StringTable
{
// blah, unrelated
}

static StringTableMgr m_StringTableMgr;
List m_StringTableList;

private static StringTableMgr Instance
{
get
{
if (m_StringTableMgr == null)
{
GameObject notificationObject = new GameObject(“StringTableMgr”);

m_StringTableMgr = (StringTableMgr) notificationObject.AddComponent(typeof(StringTableMgr));

m_StringTableMgr.m_StringTableList = new List();
}
return m_StringTableMgr;
}
}

public static StringTableMgr GetInstance()
{
return Instance;
}

void Awake()
{
GetInstance();
}

public static bool LoadStringTable(string stringTableName)
{
StringTableMgr stringTableMgr = GetInstance();

foreach(StringTable table in stringTableMgr.m_StringTableList)
{

}

// blah
}
}

This has nothing to do with what you are doing. You want to develop a car script that will have a simple variable. “isPlayer”, if it’s true, the player controls the car, if not, it may be controlled by AI, if not, it is not controlled at all.

Your player is a different story. You want to keep your player around, perhaps disable the character controller and collider for it. If you want the character to look as if he is getting in and out of the car, just play an entry animation to link the two together, and simply update the position of the character in the LateUpdate to make him look like he is driving.

I would simply make a character totally separate from the character collider and update his position and rotation every late update to either the character collider or the car.