"Can't add script component"

So, i have added the two packages Rick shows in the Argon Assault project, but when im going to “connect” my Player Controls script to the Ship, it says it can’t add the script because the script class can’t be found. This is my script;

�using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class PlayerControls : MonoBehaviour

{

// Start is called before the first frame update

void Start()

{

   

}

// Update is called once per frame

void Update()

{

    float horizontalThrow = Input.GetAxis("Horizontal");

    Debug.Log(horizontalThrow);

    float verticalThrow = Input.GetAxis("Vertical");

    Debug.Log(verticalThrow);

}

}

Hi Marcus,

Welcome to our community! :slight_smile:

Is the PlayerControls class inside the PlayerControls.cs file? Both names must be spelt exactly the same.

In your post, there is this character: �. That’s invalid in code, unless it is between "". Check if it is also in your script. Remember you can also look at the lecture code changes via the link in the Resources of each lecture.


See also:

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

Privacy & Terms