Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
This question was closed Oct 06, 2018 at 10:12 AM by tanvas for the following reason:

Problem is not reproducible or outdated

avatar image
0
Question by tanvas · Aug 30, 2018 at 08:24 PM · javascripterror messageclassesfor-loopslice

UnityScript: BCE0048: Type 'ScriptFileName' does not support slicing.

Hi Guys, I have a mistake "slicing" an class variable. For better understanding I created a test file, trying to help you guys figuring out that problem.

Code explanation:
There are two classes which are containing the key lorem_ipsum. These classes are assigned to the variables "test" & "aTest" And as you can see these two variables also do have the key lorem_ipsum with some test text as content. Then there is a for-loop which contains the string, all variables are written in. The array splits this text string after a "," What we have now is array[0] = test & array[1] = aTest. Then we should log the lorem_ipsum key from these two variables we found in the textString and split it in two tiles. And there is the error. "BCE0048: Type 'ScriptFileName' does not support slicing" In my case the script was called Inventory so the error was "Assets/Scripts/Inventory.js(94,15): BCE0048: Type 'Inventory' does not support slicing." The cause why I did this like this was that the String Content was used to call the variable by its name. (Worked fine on the website jsbin.com) So I don't know how to fix that errors, I hope you guys do.

If you don't really understand what I tried to explain you, feel free to ask me some more details. Code:

 public class ThisIsATest() {
   public var lorem_ipsum : String;
 }
 
 public class ThisIsAnotherTest() {
   public var lorem_ipsum : String;
 }
 
 function Start() {
   var test = ThisIsATest();
   var aTest = ThisIsAnotherTest();
   test.lorem_ipsum = "Lorem ipsum dolor and so on";
   aTest.lorem_ipsum = "Another text";
 
   for (var i = 0; i < array.length; i++) {
     var textString = "test,aTest";
     array = textString.split(',' [0]);
 
     Debug.Log(this[this.array.lorem_ipsum]);
   }
 }
 
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

200 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Hi! I am trying to use SceneManagement, but I keep getting errors. 1 Answer

Bonjour, j'ai l'erreur : "Assets/deplacement.js(13,24): UCE0001: ';' expected. Insert a semicolon at the end." mais je ne comprend pas pourquoi. 0 Answers

An object reference is required to access non-static member `UnityEngine.Behaviour.enabled' 0 Answers

So many errors! And I need help with the GUI 1 Answer

Enoent error: diskusage.node not found when starting Unity Hub 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges