Has anyone successfully used Invectors third person controller from unitys asset store with Tnet?
I've been trying for days to get this asset working along with Tnet....but with no success.
Now I know that I'm supposed to be syncing a controllers input with Tnet and the characters animation will automatically follow, but I just cant seem to get it working...
The Invector controller has three separate scripts which control a characters movement (thirdpersonmotor.cs, thirdpersonanimator.cs and thirdpersoncontroller.cs)
I've been only editing the 'thirdpersoncontroller.cs' to work with Tnet with the code below:
Invectors original code (the 'input' part')
/// <summary>
/// CONTROLLER INPUT - gets input from keyboard, gamepad or mobile touch to move the character
/// </summary>
public void ControllerInput()
{
if (inputType == InputType.Mobile)
input
= new Vector2
(CrossPlatformInputManager
.GetAxis("Horizontal"), CrossPlatformInputManager
.GetAxis("Vertical")); else if (inputType == InputType.MouseKeyboard)
input
= new Vector2
(Input
.GetAxis("Horizontal"), Input
.GetAxis("Vertical")); else if (inputType == InputType.Controler)
{
float deadzone = 0.25f;
input
= new Vector2
(Input
.GetAxis("LeftAnalogHorizontal"), Input
.GetAxis("LeftAnalogVertical")); if (input.magnitude < deadzone)
input = Vector2.zero;
else
input = input.normalized * ((input.magnitude - deadzone) / (1 - deadzone));
}
}
Ive edited this to show:
public void ControllerInput()
{
if (inputType == InputType.Mobile)
input
= new Vector2
(CrossPlatformInputManager
.GetAxis("Horizontal"), CrossPlatformInputManager
.GetAxis("Vertical")); else if (inputType == InputType.MouseKeyboard)
input
= new Vector2
(Input
.GetAxis("Horizontal"), Input
.GetAxis("Vertical")); else if (inputType == InputType.Controler)
{
float deadzone = 0.25f;
input
= new Vector2
(Input
.GetAxis("LeftAnalogHorizontal"), Input
.GetAxis("LeftAnalogVertical")); if (input.magnitude < deadzone)
input = Vector2.zero;
else
input = input.normalized * ((input.magnitude - deadzone) / (1 - deadzone));
}
tno.Send (1, Target.OthersSaved, input);
}
[RFC(1)]
void Move(Vector2 i){
input = i;
}
I've added Tnets original autosyncrigidbody script and it works...the character sync but not their animation...
I'm assuming Invectors other two files need to be edited?
Can someone guide me in the right direction? Ive attached the three Invector controller files if anyone is willing to help me out...