I’m trying to do basic things in JS, to get used to it and this time the error message I get is pointing to ‘runtimeobject.js’ instead of my script, and I think it because the problem is there and not in my code but I’m not sure.
So, what I’m trying to do is to move an object to the right if the cursor is over the object.
This is the code I’m using.
var speed = 10;
for(var i = 0;i<objects.length;++i){
if(objects[i].cursorOnObject()){
objects[i].setX(objects[i].getX()+speed);
}
}
And when I run the preview I get this error in the console:
Here is an example:
example.zip (2.16 KB)
Anybody could help?
Thanks