hi chris
i have problem to use touch and joystick on android platform i want some controller like shadowgun or dead trigger i use playmaker for shooting system and ac for AC Stuff .
i use first person for movement method and touch screen for input method but when i export my project non of joystick or lookaround camera not worked (like mouse look in pc platform) but if i change input method to mouse and keyboard then lookaround is worked but joystick not working . i use CNcontrol joystick and latest version of ac (1.59a) and unity (2017.1.1 ) and all input are same as your fist person video tutorial .
Comments
One specifically for CNControls has been posted on the wikia here - have you tried it?
I'm confused because you're looking to use both AC and CNControls for input - could you explain more clearly what it is exactly you're trying to achieve?
The wiki script allows overriding of AC's use of Input.GetAxis - which is used to read movement axes. However, free-aiming has its own special delegate - InputGetFreeAimDelegate.
If you can use CNControls to create that right-hand area and map it to an axis named e.g. "FreeAim", this change to the wiki script should allow you to make use of it:
using UnityEngine;
using CnControls;
public class ACInputCNControls : MonoBehaviour
{
void Start()
{
//Call AC delegate for the joystick Axis
AC.KickStarter.playerInput.InputGetAxisDelegate = CustomGetAxis;
//Call AC delegate for freeaiming
KickStarter.playerInput.InputGetFreeAimDelegate = CustomFreeAim;
}
private float CustomGetAxis(string AxisName)
{
//get the axis from CNControls' joystick
return CnInputManager.GetAxis(AxisName);
}
private Vector2 CustomFreeAim (bool cursorIsLocked)
{
//get the axis from CNControl's "FreeAim" axis
return CnInputManager.GetAxis("FreeAim");
}
}
using UnityEngine;
using CnControls;
using AC;
public class ACInputCNControls : MonoBehaviour
{
void Start()
{
//Call AC delegate for the joystick Axis
KickStarter.playerInput.InputGetAxisDelegate = CustomGetAxis;
//Call AC delegate for freeaiming
KickStarter.playerInput.InputGetFreeAimDelegate = CustomFreeAim;
}
private float CustomGetAxis(string AxisName)
{
//get the axis from CNControls' joystick
return CnInputManager.GetAxis(AxisName);
}
private Vector2 CustomFreeAim (bool cursorIsLocked)
{
//get the axis from CNControl's "FreeAim X" and "FreeAim Y" axes
return new Vector2 (CnInputManager.GetAxis("FreeAim X"), CnInputManager.GetAxis("FreeAim Y"));
}
}
If you want to override the axes, you'll have to use either Mouse And Keyboard or Keyboard Or Controller. Touch Screen input relies on internal input checks and can't be overridden in the same way.
The free-aim delegate should only respond to the CNControls axis specified in the script - it is correctly mapped in CNControls, I take it?
Now that you've separated the two scripts, what happens if you disable the Movement one and only have the Freeaiming one in the scene. Does it still cause movement? I would recommend leaving it like that for now while we fix the Freeaiming, and then re-enable it afterwards. What are the settings of this second CNControls joystick?
i forgot to insert inputs on CNControlls joystick so after I add FreeAim inputs on that everything now working just like what I want ( for anyone else that have same problem, I use two script method that I mention on last post) . so now based on your saying about override axes on Touch Screen input method , can I use Mouse And Keyboard input method on android device because so far I can see now and after some tests everything work fine on android with this settings. can be any problem on this method on the future?
and THANK YOU Chris .