Skip to main content
edited body
Source Link
Philipp
  • 121.5k
  • 28
  • 261
  • 342

It appears like your "playerBird" game object has no component of type Collider2D. Make sure that one of the 2D colliders is attached. When you want to find it via GetComponent, then it must be attached to the object directly. When the collider is attached to a sub-object of the "playerBird", use GetComponentInChildren instead.

Also keep in mind that there are also colliders which do not have the suffix "2D". These are 3D colliders used by the 3D physics engine. 2D and 3F3D colliders are completely separate systems and do not interact with each other.

It appears like your "playerBird" game object has no component of type Collider2D. Make sure that one of the 2D colliders is attached. When you want to find it via GetComponent, then it must be attached to the object directly. When the collider is attached to a sub-object of the "playerBird", use GetComponentInChildren instead.

Also keep in mind that there are also colliders which do not have the suffix "2D". These are 3D colliders used by the 3D physics engine. 2D and 3F colliders are completely separate systems and do not interact with each other.

It appears like your "playerBird" game object has no component of type Collider2D. Make sure that one of the 2D colliders is attached. When you want to find it via GetComponent, then it must be attached to the object directly. When the collider is attached to a sub-object of the "playerBird", use GetComponentInChildren instead.

Also keep in mind that there are also colliders which do not have the suffix "2D". These are 3D colliders used by the 3D physics engine. 2D and 3D colliders are completely separate systems and do not interact with each other.

Minor corrections
Source Link
DMGregory
  • 136.3k
  • 22
  • 247
  • 373

It appears like your "playerBird" game object has no component of type Collider2D. Make sure that one of the 2D colliders is attached. When you want to find it via GetComponent, then it must be attached to the object directly. When the collider is attached to a sub-object of the "playerBird", use GetComponentInChildren instead.

Also keep in mind that there are also colliders which do not have the prefixsuffix "2D". These are 3d3D colliders used by the 3d3D physics engine. 2d2D and 3d3F colliders are completely separatedseparate systems and do not interact with each other.

It appears like your "playerBird" game object has no component of type Collider2D. Make sure that one of the 2D colliders is attached. When you want to find it via GetComponent, then it must be attached to the object directly. When the collider is attached to a sub-object of the "playerBird", use GetComponentInChildren instead.

Also keep in mind that there are also colliders which do not have the prefix "2D". These are 3d colliders used by the 3d physics engine. 2d and 3d colliders are completely separated systems and do not interact with each other.

It appears like your "playerBird" game object has no component of type Collider2D. Make sure that one of the 2D colliders is attached. When you want to find it via GetComponent, then it must be attached to the object directly. When the collider is attached to a sub-object of the "playerBird", use GetComponentInChildren instead.

Also keep in mind that there are also colliders which do not have the suffix "2D". These are 3D colliders used by the 3D physics engine. 2D and 3F colliders are completely separate systems and do not interact with each other.

Source Link
Philipp
  • 121.5k
  • 28
  • 261
  • 342

It appears like your "playerBird" game object has no component of type Collider2D. Make sure that one of the 2D colliders is attached. When you want to find it via GetComponent, then it must be attached to the object directly. When the collider is attached to a sub-object of the "playerBird", use GetComponentInChildren instead.

Also keep in mind that there are also colliders which do not have the prefix "2D". These are 3d colliders used by the 3d physics engine. 2d and 3d colliders are completely separated systems and do not interact with each other.