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

same error.. 0246

Question

Hi,still with this error after one week of searching how to resolv it.. Assets/Scripts/PlaneCameraController.cs(34,60): error CS0246: The type or namespace name `Look' could not be found. Are you missing `Player' using directive? If someone want to help me thanks,if not is ok. I konw i'm beeing so annoing now... Any way,thanks

 

this is scripts

 

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; 
            }
        }
    }
}

Look script

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

namespace Player
{
    public class Look : MonoBehaviour
    {
        public float sensitivity;
        public GameObject Player;

        private Vector2 ML;

        public float SkydivingMass;
        public bool GameStarted;
        private bool skydiving;

        private void Start()
        {
            Cursor.lockState = CursorLockMode.Locked;
        }

        public void Update()
        {
            Vector2 CL = new Vector2(Input.GetAxisRaw("Mouse X") * sensitivity, Input.GetAxisRaw("Mouse Y") * sensitivity);
            ML += CL;

            if (GameStarted)
            {
                if (skydiving == false)
                {
                    transform.localPosition = Vector3.zero;
                    transform.localRotation = Quaternion.Euler(-90, 0, 0);
                    Player.GetComponent<Rigidbody>().mass = SkydivingMass;
                }

                ML.y = Mathf.Clamp(ML.y, 0, 90);
                Player.transform.localRotation = Quaternion.Euler(-ML.y + 180, ML.x, 0);
                transform.localRotation = Quaternion.AngleAxis(-ML.y, Vector3.right);
            }
            else
            {
                ML.y = Mathf.Clamp(ML.y, -90, 90);

                transform.localRotation = Quaternion.AngleAxis(-ML.y, Vector3.right);
                Player.transform.localRotation = Quaternion.AngleAxis(ML.x, Player.transform.up);
            }

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                Cursor.lockState = CursorLockMode.None;
            }
        }

    }
}

  • Sad 1

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

You are not learning at all. You are asking help for the same things again and again.
I gave links to tutorials about namespaces.

 

P.S. and you asked if 2 months will be enough to learn basics of C#? for you 20 years will not be enough.

  • Sad 1

Share this post


Link to post
Share on other sites
  • 0

or you are lazy... what is more likely.
In both cases you won't get far, if you will not force yourself to learn.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×