I'm not sure what the error is here, can anyone give me any clues on how to fix this?
Cannot read property of "0" undefined?
Javascript/Plugin SupportThat is due to a plug-in. If you installed a new plug-in, make sure you have all the required files, your project is up to date, and that you start a new game to test it. If the problem continues, please post a screenshot of all of your plug-ins.
I've moved this thread to Plug-In Support. Thank you.
as the Mod said, its difficult to help someone that post an error code without any sort of context. screenshotting the console is super duper helpful, this little guy is opened by pressing F8 on your keyboard. if you happen to be writing that plugin and are new to JS, i can help you by telling you what the error actually means.
Error : Cannot read property "0" or Undefined.
The compiler is trying to look for a property called "0" (this is kinda weird but we'll get to that). but the object it is looking for is euqal to a special JavaScript value called undefined. undefined means you are using a variable that has not been declared at all. which differs from null which means the object you have declared is equal to ... well nothing.. null.
Example:
that will give you the error "Cannot read property 'SomeNum' of undefined". The problem with this error is it is pretty much a Syntax error and can be fixed in numerous ways. With your particular error , having "0" as a property name tells me that it is a Syntax error of some kind.
Error : Cannot read property "0" or Undefined.
The compiler is trying to look for a property called "0" (this is kinda weird but we'll get to that). but the object it is looking for is euqal to a special JavaScript value called undefined. undefined means you are using a variable that has not been declared at all. which differs from null which means the object you have declared is equal to ... well nothing.. null.
Example:
Code:
myPlug.addOne = fucntion() {
myObj.someNum += 1;
}
that will give you the error "Cannot read property 'SomeNum' of undefined". The problem with this error is it is pretty much a Syntax error and can be fixed in numerous ways. With your particular error , having "0" as a property name tells me that it is a Syntax error of some kind.
Original thread: https://forums.rpgmakerweb.com/threads/cannot-read-property-of-0-undefined.77349/