Hello, I am trying to make a draggable image (called ‘icon’).
this.input.setDraggable(icon);
yields error ‘Cannot set property ‘draggable’ of null’. (InputPlugin.js error.) It entails that icon.input is null for some reason. Can’t understand why, when compared to this example, where it is not null.
The only difference I can think of is the fact that my image is declared and being set to draggable inside a function of a class extending Scene. (Using ES6 with webpack, if it matters.)
This works!
I didn’t know I needed to insert { draggable: true } as the setInteractive() method parameter. In the example I linked above, the method works without any parameters.
Thank you.
I have one more problem: this.input.dragDistanceThreshold = xxx not working, no matter where in the code I put it. Any ideas, please? I am starting to think that dragging doesn’t work well with dynamic scenes…