Thanks. I carefully watched both videos. I set it similar to as described above I don't have ragdoll method though, selected death in state drop down. Created a pre-set on third person lookat view & pressing persist & activate. l get the logic, but doesn't work for me some reason. I checked through states testing death, aim, run to try force a camera switch to occur, none caused the switch either. It's as if the saved pre-sets are not being registered, even when repeating steps in the video. Basically new pre-sets are not saving. I tried saving presets in other locations in asset folder presets or directly in my project level file either way not worked. I tried using the demo pre-set thought that may be a work around.
I tried clicking on the plus sign creating new LookAt preset nothing happens. Experimented by adding the demo Enable Look at at view pre-set but get an error doesn't use same object type. Other demo pre-sets do work like the ones in my project when I first created a character. Some of the demo pre-sets work but not all like Enable Look and creating a new one wont register. Creating a new state needs more information and clarification as its a very useful idea. Do I need to create a new camera? Are pres-sets created & saved like prerequisites in Opsive main manager?
2.5 mins into state configuration and profiles tutorial says 'if you want to create your new profile you can by right clicking,
'add state configuration create new file' I couldn't locate this in my drop down menu but in the video theres an option, I clicked the same area as the video etc. I don't have demo state configuration available either camera settings unlike shown in the video.
Be good to have more simplified and documents & tutorials creating state pre-sets. I'm just finding it hard to learn. Ideally talking through the steps involved from start to finish as if anyone could replicate those steps and get to where they need to be. I would say the state system and character swapping are 2 strong areas but needing clarifying which would really improve UCC.
I get there must be lots to explain on UCC limited time for video tutorials. Everything about UCC is brilliant and I am pleased with the way it works and progress made and the high quality etc.
Finally got the code to work. looks like the API I used before did'nt work. The Camera API with shared Utility (under Camera in Opsive documents is working fine but the one under View types wasn't working in this situation).
Below used the Opsive API to switch to LookAt as the player dies (1st script below) then back to adventure (2nd script below). This works great giving camera contol options after after the player dies. Just be good to have more state presets information.
Code:
// This worked for me using these 2
using Opsive.Shared.Camera;// *Must be implemented to script
using Opsive.Shared.Utility;// *This one works Must be implemented to script
using Opsive.UltimateCharacterController.Camera;*Must be implemented to script
public class MyObject : MonoBehaviour// 1st script LookAt veiw for death of player so players movement is no carried. 2nd return to original view.
{
[Tooltip("The character that should be assigned to the camera.")]
protected GameObject m_Character;
/// <summary>
/// Sets a third person perspective on the Camera Controller.
/// </summary>
private void Start()
{
var camera = CameraUtility.FindCamera(null);
if (camera == null) {
return;
}
var cameraController = camera.GetComponent<CameraController>();
cameraController.Character = m_Character;
cameraController.SetPerspective(false); // false indicates the third person perspective.
// Switch to the third person Combat View Type.
var viewTypeName = "Opsive.UltimateCharacterController.ThirdPersonController.Camera.ViewTypes.LookAt";
cameraController.SetViewType(TypeUtility.GetType(viewTypeName), false);
}
}
Code:
using Opsive.Shared.Camera;// For returning to original view
using Opsive.Shared.Utility;//
using Opsive.UltimateCharacterController.Camera;
public class MyObject : MonoBehaviour
{
[Tooltip("The character that should be assigned to the camera.")]
protected GameObject m_Character;
/// <summary>
/// Sets a third person perspective on the Camera Controller.
/// </summary>
private void Start()
{
var camera = CameraUtility.FindCamera(null);
if (camera == null) {
// return; no return needed on 2nd here if combining both scripts in your code
}
var cameraController = camera.GetComponent<CameraController>();
cameraController.Character = m_Character;
cameraController.SetPerspective(false); // false indicates the third person perspective.
// Switch to the third person Combat View Type.
var viewTypeName = "Opsive.UltimateCharacterController.ThirdPersonController.Camera.ViewTypes.Adventure";
cameraController.SetViewType(TypeUtility.GetType(viewTypeName), false);