Ok, after a little investigating I have found your issue.
I had a rummage around in your existing scene and could experience the issue you mentioned. Rather than changing things in there I created a new scene to experiment in.
I created a cube, flattened it out and used that as a floor. I dropped your ball prefab, changed the scale from 20 on each axis to 1 and ran then game. No problems, but no functionality.
Next I updated the BallBehaviour.cs script to include this line at the bottom of the
rigidBody.Roll(new Vector3(0f, 0f, 5f);
I ran the game, the ball started to move - great - nothing on the prefab to suggest that the ball cannot move, and confirmed that your BallBehaviour.cs script was ok.
I reverted the code changes.
I noted that the drag functionality didn’t appear to be creating the logs in the console as it did in your scene. I took a look back at what was required in order to support this and realised I needed a Canvas, this also added an EventSystem I added one of those and then added a panel which would detect the mouse pointer clicks.
I left the panel full size, so it covers the whole canvas/screen (when the game is run). I added the Event Trigger components to the panel. I then set them as follows;
Minor note, but not the source of your problem, you have the
DEnd methods wired up around the other way. You want the drag start method to be wired to the Pointer Down event and the drag end method wired to the Pointer Up event.
I ran the game again, success, your messages appeared and the ball went flying across my floor.
I returned to your scene and took a look at your canvas.
I then added a new canvas so I could flick between the two and look at differences. The first difference was the Layer that your canvas was set to, it was set to Default where-as the new canvas was set to UI. I changed yours but this made no difference to the behaviour. I disabled the new panel.
I disabled all of the panels within your canvas apart from the Touch Input. Ran the game, still no movement of the ball.
I then re-enabled the new canvas, added a panel, leaving it with the default image, moved it to the centre of the canvas, reduced its width a little, set the anchor points to the centre (e.g. not stretched) and added the two Event Triggers (as above in the screenshot). I disabled your Touch Input control, the ball behaved as expected;
(note, I’ve disabled the SpongeBob skybox in the above video so that the anchors for the panels were easier to see)
To bring the new panel more inline with your own I then removed the image, and set the alpha so that it was completely transparent.
I then copied your RectTransform values and pasted them into the new panel, ran the game, still works, although the panel now pokes out the top of the canvas.
I then duplicated the disabled L. Panel and R. Panel GameObjects from your original canvas and pasted them as child objects to the new canvas, enabled them and ran the game. Everything still worked as expected.
I cannot say what the exact issue has been, although is seems very related to your canvas and its child objects.
To resolve your issue, I would suggest;
- create a new canvas
- duplicate the L. Panel and R. Panel GameObjects and child them to the new canvas
- tidy up their positions and anchors
- create a new panel for the main centre area (between the two other panels)
- add the Event Triggers to this panel, setting the methods up in the correct order
- disable the original canvas and all child objects
- run and test the game
If it works as expected, delete the original canvas and child game objects.
Hope this helps