- Home /
How to make physics collision dotted simulation like bubble shooter ?
Hye! guys i want to achieve dotted physics simulator as shown below
Im have done some sort of work previously by Unity particle system .They are working fine but the problem is when rotate the pointer a wave is formed . Is there any other way
Answer by Matt1000 · Nov 15, 2018 at 02:36 PM
I have done things like this in a 3D environment with gravity so I think the same solution should do the trick. First, you need to know exactly how the ball will execute it's physics once you shoot it. In my case, I considered gravity equations and free fall but this seems simpler so don't worry.
Then, you need to have a method that will iterate based on the initial settings you give it (direction, speed, etc.) and simulate the ball's movement. Whenever this simulated ball touches a wall you should change its direction and save that point in a list. Finally, when the ball touches another one save that point too, end the iteration and return the list with all of the points.
Those points are all the extremes your line should touch, in that same order. Just remember having the initial position too and that's about it. It's easier once you start writing it.
Answer by hectorux · Nov 15, 2018 at 02:23 PM
I think(I have never done something like this), that you have to make your custom game physics. Then, knowing the rules of your physics set a dot every X distance or time. If your game works as simple as the bubble, then it will be easy, just check with what collides using a raycast, then calculate distance and using reflection you know the direction of the bounce with the wall
@hectorux i have tried your approach I think its simple and makes sense.! By the way thanks for your quick response.
Your answer
Follow this Question
Related Questions
Water physics in solid object 2 Answers
Make a particle system with particles that stick to everything once they collide 0 Answers
How do I solve the Box Collider (3D) Edge / Corner Collisions problem? 5 Answers
Rigidbody is behaving abnormally when transformed manually 0 Answers
Character Controller meets Rigidbody 1 Answer