Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question about Error message.

Discussion in 'Editor & General Support' started by RetroDan, Mar 8, 2016.

  1. RetroDan

    RetroDan

    Joined:
    Dec 12, 2015
    Posts:
    5
    Can someone please explain this line and error? in the attached screen shot.

    PlayerPrefs p = GameObject.Find("Player").GetComponent<Player> ();

    Also, is this the correct forum for this?
     

    Attached Files:

  2. Ignacio-Liverotti

    Ignacio-Liverotti

    Unity Technologies

    Joined:
    Jul 23, 2015
    Posts:
    36
    Hello RetroDan,

    It seems you're trying to assign a Player type to a PlayerPrefs one. I cannot provide further help without a bit more context. Is 'p' meant to be a Player instance or a PlayerPrefs instance?

    Best,