Hi, I've been using some actions directly through scripting. Like so:
//all this block of text goes into a custom method, along with others
ActionCharFace actionCharFace = ScriptableObject.CreateInstance<ActionCharFace>();
actionCharFace.isPlayer = true;
//actionCharFace.faceType = CharFaceType.Body;
actionCharFace.faceObject = MainCam.gameObject;
actionCharFace.Run();
Till now, all of the ones I've tried have worked perfectly (camera crossfade/switch, manage systems, player constrain and plenty others), and it's great for automating complex series of actions, but I cannot get the ActionCharFace to do it's thing. Basically, what I want is to make the character (Player,Npc,etc) face the camera automatically (by calling the method from a loop/coroutine when appropriate). I've tried providing the script with the gameobject from all my cameras, and the MainCamera (like below), but no matter what I do nothing happens. And I'm fairly certain that the code is being reached fine (I've put some debug.logs).
public static MainCamera MainCam;
//third person cam and travel cam
public static GameCameraThirdPerson CloseUpCam;
public static GameCamera TravelCam;
MainCam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<MainCamera>();
CloseUpCam = FindObjectOfType<GameCameraThirdPerson>().GetComponent<GameCameraThirdPerson>();
TravelCam = GameObject.Find(TravelCamName).GetComponent<GameCamera>();
Am I missing a parameter/variable that needs to be set, or like I'm guess am I just using it wrong? (because, this same camera references are working just fine with camera crossfade)
Comments