Hey guys,
I’m trying to reproduce a Zuma/Luxo/Tumble Bugs game in a 3D environment.
My only problem is: how can I get the balls to push each other?
I pretty much solved everything else but I really can’t find a solution to this one problem.
In a game like this, the balls wouldn’t really push one another, they’d move in such a way that looks as if they were pushing other elements. It’d be smoke and mirrors. Physically correct implementation would be exceptionally complex in UE4, not sure if possible with Apex to start with. Chaos, perhaps, is more capable.
I pretty much solved everything else
So how are you moving the balls atm? I could suggest something but it may go against what you’ve got. Could you briefly iterate through the mechanics you’ve implemented so far? How are you adding the balls to the spline, for example? How are you tracking what’s where?
For something like this I’d avoid physics, for sure.
you know the length of the spline, so you know how many elements will fit
think of a spline as a collection of empty slots represented by an array
each ball occupies a specific slot - an index
you can insert, add and remove balls in the array at specific index
the balls don’t really push anything, you slide the them from slot to slot based on their current index
if there are slots on the spline with no ball assigned, everything beyond that slots shifts their index
the animation will be best done with timelines - most control
That’s the gist. That’s how I’d approach it at least.
Disclaimer: never made anything like this before so it may not be the best approach or even a good one - merely a suggestion; but I’ve made rollercoaster games (an overstatement) where stuff moves around in a similar fashion, sort of. And that worked well enough.