I had an issue with my Paddle in the game

Someone else had this issue previously, so big ‘Thank you’ to @zavy and @Nina for the fix, located here:

Like Zavy, my code would not compile. The only thing that I did differently from Rick was that I named my paddle script as “PaddleController.cs” rather than “Paddle.cs” so it would be a little more clear to me.

Because of this, Unity could not find the reference to the “Paddle.cs” script and would not compile.

Once I renamed my serialize field to “PaddleController”, everything compiled as expected.

Thank you @Nina and @zavy for solving this and posting the solution!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BallPosition : MonoBehaviour
{
    [SerializeField] PaddleController paddle1;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
1 Like

Thank you for sharing this :grin:

1 Like

Oh yes, that’s a typical mistake everybody makes at some point. Thanks for posting your solution. :slight_smile:

Thank you @Nina!

I must have spent about 20 minutes on this before I started checking the messages and seeing if someone else had already solved it.

I know I was just reposting the way you helped someone else solve it earlier, but I feel like I owe you dinner or something about 10 times for all of the times you’ve helped me out! :slightly_smiling_face:

I appreciate your help!

Absolutely. Sometimes, it is impossible to find a solution just because one looks for the “wrong” keywords. I sometimes have to bookmark certain solutions because I will not be able to find them again even if I encounter the same problem again. Problems and solutions phrased in different ways increase the number of “correct” keywords. :slight_smile:

Privacy & Terms