Ball Movement In 3D / Vectors Relative to Current Direction

Hi,
I followed the Marble Madness tutorial which is great. I then wanted to push this demo further by getting the camera to follow the ball behind it (which I did successfully).
I then turned off gryo and instead decided to add some virtual D-Pads to the screen which provide a -1/+1 value for both the X/Y location where you touch (based on code from Apple’s demos).
The left pad should control the ball direction (forward / backward and turn it left or right) whilst the right D-Pad controls the camera.

I now want to map the left D-Pad values to the vector that the ball travels in.

The trouble is, when I press it, pressing right on the D-Pad always makes the ball travel globally in the same direction - not relative to its current location or vector.

I’ve tried for hours to change this, and have played around with “convertVelocity” methods but I can’t get it to work.

I’ve attached an image showing my screen.

If anyone else has had this trouble, I would really appreciate your thoughts.
James

This topic was automatically closed after 166 days. New replies are no longer allowed.