Alright, let me start by saying I am 100% new to Unity, so I’ve no idea if some of these things are normal or not, though I know my first problem isn’t.
Alright, I was attempting to code in a test level the ability to use my 360 controller after getting my basic navigation functionality in. The mouse and keyboard commands worked perfectly fine. I setup the input manager correctly as what my code is saying is what it’s doing, but with some minor complications. It always wants to go to the right, even when I’m not pushing my the joystick on the 4th axis. So I decided to debug it and made a fresh world with no other coding except for the coding. This is literally the code I used:
using UnityEngine;
using System.Collections;
[RequireComponent (typeof (CharacterController))]
[RequireComponent(typeof (Rigidbody))]
public class PlayerMovement : MonoBehaviour
{
float RotationSpeed = 180;
void Update ()
{
Movement();
UserInputs();
}
void Movement()
{
transform.Rotate(0, Input.GetAxis("360_X") *Time.deltaTime * RotationSpeed, 0);
}
void UserInputs()
{
if(Input.GetAxis("360_X")>0.999999)
{
Debug.Log("360_X!");
}
}
}
Third and fourth lines are just simple force of habit… Anyways, the thing is, even like that it sends a signal that the 4th Axis is being pressed. I thought it was my controller so I simply saved and closed Unity and played one of my controller enabled game and it worked perfectly without rotating in circles like a ninny. So then I considered it was simply my coding so I imported the fps controller package to test that, then that started to wander to the bottom right after setting up the controller’s 4th Axis. Then I watched a few Youtube videos of someone coding in XBox controller compatibility and they wrote very similar and basic coding and set up the input manager in the same basic manner and had perfect control without it wandering off to the side. Is this a glitch that happens with free users, or are some brands of 360 controllers simply not compatible with Unity? The two controllers I check with was a 360 Afterglow and the other was a 360 Madcatz… the cheap one with the GameStop logo on it. Both are practically brand new (a few months old) and as mentioned work perfectly with other controller compatible PC games (meaning it also can’t be my usb ports) and my 360.
Also another problem I noted is that when I allow any function to move (forward, backward, right, left, or rotate on any axis) to anything, even a cube, it bounces around and flies off like the ground is made of rubber (it isn’t) and doesn’t stop until I stop the game and select ‘Is Kinematic’ or deselect ‘Use Gravity.’ Is this normal functionality for Unity?