I have multiple balls and made user give a path to the ball.
I have taken the input and put it in an array/list.
Now I want my ball to follow that path( which can be done with just simply changing its position every frame) but I also want my ball to collide with other balls and have physics been applied.
All my balls are RigidBody2D and with my current code which just changes position the ball go through each other.
I am trying to find out a way to be able to give the ball a velocity and make it follow the path(which I have in an array) & if it collides make it follow simple 2D physics rules.
I used to have the same problem as yours.
What I did for the solution is that I add 2 boolean flags, one call lostControl another call settleDown, to decide should the object, in your case is the ball, be controlled by the predefined path or physical impact force. Make the OnCollisonEnter() to set lostControl = true and OnCollisonExit() to set settleDown = true.
Then you could have them in your object’s (your moving ball) FixedUpdate() to handle movement differently. For example, if lostControl = true will follow simple 2D physics, otherwise will keep moving in path. You could use settleDown for putting your object back to the path or anything like that.