I tried ball.velocity = Vector3.forward * speed and also *=-1 when the collision is occurred(It only works for straight way. But I want the ball movement be liked in photo. How can i do it? Thank you very much!
If you have the velocity vector v and the normal vector n (the vector pointing in the direction the wall is pointing too), then it's simply
$$\vec v_2=\vec v-2 \vec n (\vec n \cdot \vec v)$$
Where v2 is the new direction vector
You could think of this as "sliding" the end of the velocity vector twice as much as it's facing in the wall's direction or by negating one of it's components