Rigidbody hides inherited member compiler warning?

I am getting a compiler warning for the declaration:

Rigidbody rigidbody;

The warning is: ‘Rocket.rigidbody’ hides inherited member ‘Component.rigidbody.’ Use the new keyword if hiding was intended.

The source code in the git repo shows the code exactly like I have it (and not the use of the “new” keyword):

I am using Unity 2018.2.14f1 .

The git r

I cut and pasted the git repo version of the Rocket class into Visual Studio and the warning went away.

It isnt exactly the same. You have rigidbody the Git repo has rigidBody.

C# is case-sensitive thus these declarations are different.

Yes - that makes sense! Thanks!

1 Like

You’re very welcome. :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms