Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
lucian112

error CS0246

Question

Any ideas why? Exactly like in video..

error CS0246: The type or namespace name `Look' could not be found. Are you missing `player' using directive?

Here's the script

---------------------------------------

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

public class PlaneCameraController : MonoBehaviour
{
    public NetVars NV;
    public GameObject Camera;
    public GameObject SkyDiveText;

    private void Start()
    {
        NV = GameObject.Find("_NetVars(Clone)").GetComponent<NetVars>();
    }

    private void Update()
    {
        if (NV.GameStarted)
        {
            //activate the camera
            Camera = GameObject.Find("PlanePivot(Clone)").transform.Find("Plane").transform.Find("PlayerCamera").gameObject;
            Camera.SetActive(true);
        }

        if (NV.PhaseIndex == 1)
        {
            SkyDiveText.SetActive(true);

            if (Input.GetKeyDown(KeyCode.Space))
            {
                gameObject.transform.position = Camera.transform.parent.transform.position;

                transform.Find("CameraPivot").GetComponent<Look>().GameStarted = true;
                Destroy(Camera);
                this.enabled = false; 
            }
        }
    }
}
 

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

It means that you are trying to call a script (look) which doesn't exist on your object CameraPivot ++

Share this post


Link to post
Share on other sites

  • 0
Please login or register to see this quote.

you had team viwer to help me if u want or had some time. I had Look script.Or u can explain how to resolv it?

https://imgur.com/a/kQKmiMQ

Share this post


Link to post
Share on other sites
  • 0
Please login or register to see this quote.

Please login or register to see this link.  is called like this.. Any ideas? Or what's wrong

Share this post


Link to post
Share on other sites
  • 0

So I would like to know if this script is attached on your gameobject named CameraPivot?

Share this post


Link to post
Share on other sites
  • 0

Do you have two scripts with the namespace “Look”? If I remember correctly they cancel each other out and throw that same error. Happened a couple times to me when I first started using unity and created a mouselook but also had the standard unity mouselook in the project

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...