Hi,
I'm trying to program gamepad support and it was going well until I started programming the input for pushing down the left joystick on an xbox one controller,, and I got this error massage: "NullReferenceException: Object reference not set to an instance of an object. " and I dont know what to do.... heres the area of code were the error is -
`buttonInput = GetComponent();
bool lPushed = buttonInput.leftStickPushed; // <--- apparently this is the wrong part....`
and this is the W.I.P input script - `using UnityEngine;
using System.Collections;
public class GamepadSetup : MonoBehaviour
{
//create gamepad input
public bool leftStickPushed = Input.GetKey(KeyCode.Joystick1Button8);
public bool rightStickPushed = Input.GetKey(KeyCode.Joystick1Button9);
}`
thanks!
Jack
↧