using UnityEngine;
using System.Collections;
namespace YourNamespace
{
public class CameraRigFix : MonoBehaviour
{
private Vector3 initialPos = Vector3.zero;
private Quaternion initialRotation = Quaternion.identity;
private com.ootii.Cameras.AdventureRig rig;
void Awake()
{
rig =
GameObject.FindGameObjectWithTag("MainCamera").GetComponentInParent<com.ootii.Cameras.AdventureRig>();
if (rig != null && rig.Anchor == null)
{
rig.Anchor = gameObject.transform;
rig.Camera.transform.localPosition = initialPos;
rig.Camera.transform.localRotation = initialRotation;
}
}
// Sometimes to Awake is too late
void Start()
{
if (rig != null)
{
rig.Camera.transform.localPosition = initialPos;
rig.Camera.transform.localRotation = initialRotation;
}
}
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
Did you try some other popular controllers from the asset store too?
I did notice yesterday that my player character isn't turning to face my NPC when testing the simpleDialogue in the tutorial. Wondering if there is something additional we should have him add to the MC2 core to handle this? I did confirm my Event Interaction attached to the NPC is toggled to both turn the player to event and turn event to player. I'm wondering if I've missed something somewhere else in the setup of the character. With having my custom controller setup in base/control for the player character, I don't have to do anything with animations at all in ORK for that character, right? Since player control is set to None and I have my custom control 0 set to my Motion Controller script attached to the player prefab, right? With this being a new install, I don't have that stuff set up because I didn't think I needed it. When I tested during MC beta, I integrated into an existing ORK project that did have mecanim stuff configured already since I already had NPC characters rigged.
*ponders* lol
At any rate, thanks for the script! I'll play around with it when I get to that point in setting things up. :)
@Shawn67 " I don't have to do anything with animations at all in ORK for that character, right? "
It depends on the Battle type you are going to use, or lets say if you are using Real Time Battle then you don´t need to bother setting up ORK animations for your player.
Up to now I´m still using my own character controller + Adventure Camera Rig, I will switch to Motion Controller v2 as soon I finish to map all the animations to the MC framework.
In my scenario I´m using both, a player prefab with humanoid rig for no battle control and a player prefab with legacy rig for battles (which ORK handles very well). I used Skele to convert the mecanim animations to legacy ones.
Thanks for the info. :)
Chris