Buenas tardes, me estoy volviendo loco para poder usar el controlador de Xbox 360 con el movimiento de este caballo....
el Script esta para que se mueva con las teclas w,s.a.d o con las arrow, pero quiero mapearlo a el controlador de xbox....
Ya tengo puestos en el input todos los posibles axis, botones etc...
Pero ahora me encientro que no veo la manera de aplicarlos para que se mueva con ellos....
Agradecería una ayuda por favor.
Adjunto todo el script aunque no creo que aga falta pero para facilitar ;
using UnityEngine;
using System.Collections;
using UnityStandardAssets.CrossPlatformInput;
[RequireComponent(typeof(HashIDs))]
public class HorseController : MonoBehaviour
{
public enum HorseMeshType
{
Horse1 = , Horse2 = 1, BigHorse = 2, PolyArt = 3, MineCraft = 4, Custom = 5
}
//float normalizedtime;
#region Variables
#region Connection with Rider Variables
[Tooltip("Enable this if you want to control the horse alone, without requiring mounting")]
public bool PlayerControlled;
[Tooltip("This activate the animator layer that contains the horse's bones offset, in order to use the same animation. Custom is for use your own Horse Model")]
public HorseMeshType horseType;
[HideInInspector]
public bool Mounted;
[HideInInspector]
public bool Mountedside;
[HideInInspector]
public Animator RiderAnimator; // Rider's Animatorto control both Sync animators from here
#endregion
#region Horse Components
private Animator anim;
private Rigidbody horseRigidBody;
private BoxCollider horseCollider;
private HashIDs hashs; //Hash ID For the animator parameters
private float scaleFactor;
#endregion
#region Animator Parameters Variables
private float speed;
private float direction;
private float MaxSpeed = 1f; //1 Walking, 2 Trotting, 3 Cantering, 4 Galloping, 5 Sprinting
//States Variables
private bool
galoping,
trotting,
swimming,
flying, // Coming Soon Pegassus
falling,
fallingback,
sleep,
jump,
Shift, //Cantering ,Sprint, turn 180
attack,
IsInWaterHip,
IsInWater,
stand,
fowardPressed = false;
private int sleepCount, horseInt;
private float horizontal, vertical, horsefloat = , MaxHeight;
private float jumpingCurve;
#endregion