Rigidbody2D not being Found

I am getting an Error under Rigidbody2D is not being found. Is anyone else seeing this error? I am following the Unity 2D RPG: Complete Combat System course.

1 Like

Try changing your code to this:

rb = GetComponent<Rigidbody2D>();

This changes from a . to an =
Hope this helps!

Hi Jobson,

Welcome to our community! :slight_smile:

Christopher is right. You don’t want to call (.) the GetComponent method on the object assigned to rb. Instead, you want to assign (=) a Rigidbody2D object to rb.

Remember you can also look at the lecture code changes via the link in the Resources of each lecture.


See also:

1 Like

Hey Christopher Thank you That did help!

1 Like

Thank you Nina!

1 Like

Glad I could help!

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

Privacy & Terms