Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to Create Script

Discussion in 'Getting Started' started by wkopp, Jul 12, 2019.

  1. wkopp

    wkopp

    Joined:
    Jun 4, 2019
    Posts:
    1
    Using first generation leap motion and I want to create a script in unity. I imported the Leap Motion Core into Unity and I attempted to run the sample scene. I get the error "warning CS0618: 'PrefabType' is obsolete: 'PrefabType no longer tells everything about Prefab instance.' How do I fix this? Using 4.4.0 Leap Motion Package
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You're getting a warning not an error. PrefabType was marked obsolete with 2018.3, I'm sure due to the major redesign of the prefabs system. The script might still function as is, or there might be broken functionality. Since Leap Motion's own website says their version support is:
    I'd suggest just using 2018.1 or 2017.4 (probably 2017.4 since it is in LTS) rather than trying to upgrade their asset to a later version of Unity for them.

    To actually answer your question though, depending on what the script is using PrefabType for, to stop the warning you'd likely replace it with either PrefabInstanceStatus or PrefabAssetType, as the functionality of PrefabType was split between those two it appears.

    You might get help from someone who has actually gone through this with Leap Motion though if you named your thread in a way which indicated the topic you are asking about. I expected this thread was a question about creating scripts, not fixing an existing script from a 3rd party.
     
    JoeStrout and Antypodish like this.