Aerial Control... Need help!

Hey, so I’ll keep it short: I need help with a really simple thing, I’m using the “Standart Assets” package and I need help with scripts for the rollerball. This seems to be the case that while in air I can’t move in any directions (obviously). Need help with the script so I can move in air (change directions and what not).
Thanks

tl;dr:
Need the ball to move in directions while in-air (using Standart Assets Rollerball Script)

Script:

using System;
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;

namespace UnityStandardAssets.Vehicles.Ball
{
public class BallUserControl : MonoBehaviour
{
private Ball ball; // Reference to the ball controller.

private Vector3 move;
// the world-relative desired move direction, calculated from the camForward and user input.

private Transform cam; // A reference to the main camera in the scenes transform
private Vector3 camForward; // The current forward direction of the camera
private bool jump; // whether the jump button is currently pressed
public GameObject player;

private void Awake()
{
// Set up the reference.
ball = GetComponent();

// get the transform of the main camera
if (Camera.main != null)
{
cam = Camera.main.transform;
}
else
{
Debug.LogWarning(
“Warning: no main camera found. Ball needs a Camera tagged "MainCamera", for camera-relative controls.”);
// we use world-relative controls in this case, which may not be what the user wants, but hey, we warned them!
}
}

private void Update()
{
// Get the axis and jump input.

float h = CrossPlatformInputManager.GetAxis(“Horizontal”);
float v = CrossPlatformInputManager.GetAxis(“Vertical”);
jump = CrossPlatformInputManager.GetButton(“Jump”);

// calculate move direction
if (cam != null)
{
// calculate camera relative direction to move:
camForward = Vector3.Scale(cam.forward, new Vector3(1, 0, 1)).normalized;
move = (vcamForward + hcam.right).normalized;
}
else
{
// we use world-relative directions in the case of no main camera
move = (vVector3.forward + hVector3.right).normalized;
}
}

private void FixedUpdate()
{
// Call the Move function of the ball controller
ball.Move(move, jump);
jump = false;
}
}
}

EDIT:
I’m a begginer, like a total noobie :slight_smile:

I don’t see any code that is looking if the player is in the air or not.
is that code in the Ball script? I see you’re passing bool jump to the Ball.Move function
So I think we need to see the Ball script

using System;
using UnityEngine;

namespace UnityStandardAssets.Vehicles.Ball
{
public class Ball : MonoBehaviour
{
[SerializeField] private float m_MovePower = 5; // The force added to the ball to move it.
[SerializeField] private bool m_UseTorque = true; // Whether or not to use torque to move the ball.
[SerializeField] private float m_MaxAngularVelocity = 25; // The maximum velocity the ball can rotate at.
[SerializeField] private float m_JumpPower = 2; // The force added to the ball when it jumps.

private const float k_GroundRayLength = 1f; // The length of the ray to check if the ball is grounded.
private Rigidbody m_Rigidbody;

private void Start()
{
m_Rigidbody = GetComponent();
// Set the maximum angular velocity.
GetComponent().maxAngularVelocity = m_MaxAngularVelocity;
}

public void Move(Vector3 moveDirection, bool jump)
{
// If using torque to rotate the ball…
if (m_UseTorque)
{
// … add torque around the axis defined by the move direction.
m_Rigidbody.AddTorque(new Vector3(moveDirection.z, 0, -moveDirection.x)m_MovePower);
}
else
{
// Otherwise add force in the move direction.
m_Rigidbody.AddForce(moveDirection
m_MovePower);
}

// If on the ground and jump is pressed…
if (Physics.Raycast(transform.position, -Vector3.up, k_GroundRayLength) && jump)
{
// … add force in upwards.
m_Rigidbody.AddForce(Vector3.up*m_JumpPower, ForceMode.Impulse);
}
}
}
}

This is the ball script.

this is all you need to add

public void Move(Vector3 moveDirection, bool jump)
        {
            // If using torque to rotate the ball...
            if (m_UseTorque)
            {
                // ... add torque around the axis defined by the move direction.
                m_Rigidbody.AddTorque(new Vector3(moveDirection.z, 0, -moveDirection.x) * m_MovePower);

                if (!Physics.Raycast(transform.position, -Vector3.up, k_GroundRayLength))  // add this if statement
                {
                    m_Rigidbody.AddForce(moveDirection * m_MovePower);
                }
            }
            else
            {
                // Otherwise add force in the move direction.
                m_Rigidbody.AddForce(moveDirection * m_MovePower);
            }

            // If on the ground and jump is pressed...
            if (Physics.Raycast(transform.position, -Vector3.up, k_GroundRayLength) && jump)
            {
                // ... add force in upwards.
                m_Rigidbody.AddForce(Vector3.up * m_JumpPower, ForceMode.Impulse);
            }
        }

Thank you sooo much <3