[Help]problem with attaching game object in script rather hen drag and drop

As similar to the videos i am successful up to creating level_02 and dragging the object for ball and lose collide .But when i try to do that in script i am having a error (‘ball.Paddle’ is a ‘field’ but a ‘type’ was expected)

Hello @Manish_e.v,

The problem here is one of capitalisation.

paddle is your variable where-as Paddle is the Type (the name of your class), therefore if you change the following line;

paddle = GameObject.FindObjectOfType<paddle>();


paddle = GameObject.FindObjectOfType<Paddle>();

the error should go away and you should be ok.

Hope this is of help. :slight_smile:

1 Like

Privacy & Terms