I want to make game based on concept of Zuma...

I want to make game based on concept of Zuma…Whenever i fire ball towards ballset which is moving towards centre destination point, it does not stick there to continue path.But it get bounce.Please help me that i am noob in unity…

1 Like

Hook up with @Kishorprajapati007 who has the same problems.

hahaha…

Yes, i think so…

I would suggest not using physics directly and just using math. I was building one about a month ago, and physics can be a little unpredictable. By using paths and controls and basically programmatically animating all the action, you can get pretty nice results.
Here is my experiment :

(sorry, its a bit dark, the art and stage is still heavily in progress. :wink:

3 Likes

Thanks friend.Really gr8 video and can understand you worked harder.I would thankful if you help me to get code for spawning of ballset properly.:slight_smile:

Woow its a great game made by you, @zombiegorilla

It would be great if you will help us to make a game like yours.

Thanks.

I’ll be happy to answer specific questions. Like I said, I would recommend using paths/splines and controlling the motion programmatically instead of using physics, it’s much less overhead and much more control.
Here you can see the pathing setup that I use for the balls. I use DOTween to determine the distance, and move them along based on distance(size) of the balls.

Here is a look from the editor.

1 Like

I want to know that how ball get place near the target ball-set. Also facing problem while generating ballset .Can you provide me code for ball spawning and shooting.If possible?:face_with_spiral_eyes:

Hi zombiegorilla,

I had attached a screen shot, where i am facing a problem. I want to generate balls from my starting path in a random colors with the rolling effect.

Plz Help
Thanks,

I won’t provide any code, but I’ll certainly share what I am doing conceptually. What problems are you having creating the balls? I am doing nothing fancy there, I just instantiate them from a random set of prefabs. To keep things running smooth, I pre-generate all the balls (and a small pool for the ones being fired). That prevents any slow down or frame drops.

For the path, I use waypoints. (a series of empty transforms) You can use either iTween or DOTween traverse the path. I prefer DOTween. I create a new tweener each of balls (that is stopped initially). I then just .Goto on the tweens to move them along path at specific points. (Simple Waypoint System also works well, as you can just get a normalized position on a given path.). All the balls are in an array, that is compressed (when balls are removed) and expanded (when balls are added). It actually works pretty much automatically because I bind the location to the array index. So when say 4 balls are removed, the array compressed the 5th ball now is bound the same location that the first was, it will roll quickly back to that place.

The rolling is essentially faked. I align the ball’s forward axis to the path, and the mesh and effects are nested in side the main transform. I rotate the inner part based on percentage of location. I actually spin them a little faster than they would in reality. (1.2* the actual rotation). It just looks a little more dynamic.

Shooting is done pretty much the normal way, translated along the forward axis of the cannon,

5 Likes

Thank You for the help,

Hi zombiegorilla,
Thanks for help.I am facing problem while spawning ball set and ball movement. I have created prefab of ‘Ball’ which is sphere gameobject.I have used iTween for pathfinding. When i tried to spawn 10 balls using ‘Ball’ prefab clone.But unable to add ballmovement (script) for path towards destination.Please help me out.Here attaching file for more info.

1920291–123957–Game.rar (421 KB)

Does spawned ballset prefab contain rigidbody component?your help is highly appreciated.

I don’t use iTween, I don’t think it has the same features for pathing that DOTween does. The big one be being constant speed traversing a path. When I experimented with it, the speed was constant between nodes, so if nodes A and B are very close, and C is very far, it will appear that things travel between A and B much slower. At the time when I looked for a clean pre-rolled solution for this SWS (Simple Way Point System) was the best option and had the cleanest pathing. After using it I realized that they were leveraging HOTween (at the time), which introduced me to the never-ending joy of DOTween.

Yes, the balls do contain a rigidbody, BUT, it is not used for physics at all, just for collision detection and for the beam to bounce of off. All motion is done by moving the objects directly.

Hi zombiegorilla,
Do know how to reuse a created Tween? I tried create a Tween for each ball, and the game gets incredibly lagging. Since every ball follows the same path, is there a way to share the tween? Or can you tell how you made the game smooth while each ball moves along the path?

I only create one tween. It essentially has an empty on it that serves as a proxy. As I move each ball I move that proxy to the ball, normalized position on the path and get the new position and look ahead to keep it aligned. This way I only have one path, and the balls have individual control over their own speed and location.
Though with each group the in sequence base that on the ball in front. That allows all balls behind a insert to slow down or if there is a gap balls behind that gap move faster to catch up.

hi @zombiegorilla . can i ask a question about the pathing movement?

how do you keep the speed constant over curve and straight lines?

thanks

Dotween handles that. That is one of the many reasons I like that library. ;). I move the balls manually, converting the distance to a percentage of the path and getting the location from the path. Some of the other tweeners don’t do consistant distance, iTween didn’t that is why I looked for a better solution.

wow that’s a fast reply. Thanks for the time! Well i’m considering to get the Dotween pro.

thanks again!

@zombiegorilla what version of Unity do you currently use or recommend… just curious :wink:

Thanks