I have some understanding of c# and I am new to unity. I am currently making a 3D project which use the Rigidbody component on the ball object. When I use following code:
public class Ball : MonoBehaviour
{
public float launchSpeed;
private Rigidbody rigidbody;
// Use this for initialization
void Start()
{
rigidbody = GetComponent<Rigidbody>();
rigidbody.velocity = new Vector3(0, 1, launchSpeed);
}
// Update is called once per frame
void Update()
{
}
}
I get the compiler warning:
'Ball.rigidbody' hides inherited member 'Component.Rigidbody'. Use a new keyword if hiding was intended
I understand the idea behind using new and override in c#, but I just don't understand why is the rigidbody hidden?
I am using Unity 5.2.0f3, and MS Visual Studio Community 2015.