Hidy ho,
It's been a while since I've been deep in the weeds of AC, but I have a question related to using it with one of Unity's character controllers.
The tutorial at
http://www.adventurecreator.org/tutorials/adding-custom-motion-controller is written using the 3D motion controller, and I tried applying the same code/logic to the Platformer 2D controller I'm using (which comes with Unity 5's standard assets). I got as far as blocking player input during cutscenes, but I can't seem to manually disable player input/movement using the engine > manage systems action, or get the character to obey walkto actions.
Here's what I have:
using UnityEngine;
using System.Collections;
using AC;
using UnityStandardAssets._2D;
public class ACCustomControllerLink : MonoBehaviour
{
private PlatformerCharacter2D controller;
private Platformer2DUserControl control;
private Player player;
private Vector3 targetpos;
// Use this for initialization
void Start () {
controller = GetComponent<PlatformerCharacter2D>();
control = GetComponent<Platformer2DUserControl>();
player = GetComponent<Player>();
}
// Update is called once per frame
void Update () {
control.enabled = player.CanBeDirectControlled();
targetpos = player.GetTargetPosition();
if (player.CanBeDirectControlled () == false) {
controller.transform.position = targetpos;
}
}
}
Comments
Instead, you should use the Player: Constrain Action to limit movement. Locking "Movement" (or "Up movement", depending on your settings) will affect the output of the following bool check:
KickStarter.playerInput.CanDirectControlPlayer();
Use that in place of your placer.CanBeDirectControlled() check.