I’ve only recently started programming, so I hope this is an easy fix. Anyways, I started out with my script functioning in the 2D sections of unity. I originally could not get rigidbody2D.AddForce(x,y); to work, so as I test I moved it all over to 3D for rigidbody3D.AddForce(x,y,z); and it worked! At this point, I’m entirely unsure of what the problem is. Here is the portion of the script using this.
//If player is moving and if player is not moving too fast;
if (Input.GetButton ("Horizontal") ) {
//Set horizontal movement;
if(velocityTracker < velocityCap ){
rigidbody2D.AddForce(speed * horizontal * Time.deltaTime * 100 * boostX, 0f);
Debug.Log (rigidbody2D.velocity);
}
}