Hi!
I’m working on a traditional ‘snake’ game, where each time the player eats an apple, their body grows by one segment.
At the moment, I have an array of static mesh components (just spheres), called ‘BodyBits’ - which gets added to, each time an apple is eaten.
In order to get each segment following the previous segment, on tick I’m using the function ‘Move Component To’, by taking an array element in BodyBits, and setting the target location as the previous element in the array.
This appears to work fine… for a couple of iterations (the spheres follow each other in a snake like fashion). But after eating a third apple, the thing breaks- and additional spheres stop following the previous sphere.
Now- I’m pretty sure the way I have things setup is not optimal (running through a loop on tick, and using a function ‘Move Component To’ which executes over a number of frames depending on how I’ve set the ‘over time’ parameter). So I’m looking for advice on how I might better be able to set up this chain like effect, with components being progressively added and automatically following the previous one.
Thanks very much for your time!
Ekar