Hello,
I manage to bounce the ball, the next thing I want to do move the ball forward on mouse click or tap on the mobile device.
I am sharing the short video and screenshot to let you guys understand what I want to achieve.
Regards,
M.Aqib
2733034–194280–How_to_Move.zip (242 KB)
If you’re using a rigidbody, add this code to the camera.
Assuming this is a multiplayer game, then flip player 2’s camera to the other side of the field so the ball still goes left relative to them.
public float speed = 5.0f
if(input.getKeyDown(0))
{
rigidbody.AddForce(transform.right*speed);
}