Well, the class below is the only thing I messed with, is the player blueprint for the worm game, so the bug is 100% in the image below, problem is that I don't have the slightest idea of how to debug it x_x
Though if someone feels brave enough and wants to take a look, I have commented the section with what I think and hope my code is doing, but probably is not...
Basically my whole reasoning was this:
We start driving the "Head" of the worm, when we Hit a Pickup then we use its location to initialize a new StaticMesh and store it in the Array of StaticMeshes that represents the "body blocks" of the Worm, and of course the last element we added thus the last index is always the (new) "Head".
So to update the position my idea was that every index starting from 0 and except the last is set to the position of the index in front of it, and then the last index (the Head) moves in the direction of the key pressed (since it has no other block to follow).
Also we don't update position the turn we hit the pickup because the rest of the body don't move and the the new head is added where the pickup was.
I also put a poor quality video below so you see Unreal engine exploding Blue is the Worm, green is the Pickup. By the way, also notice that the blocks of the body even though being added and showing up at the correct location, are not moving at all...
http://i.imgur.com/Ytaq2Yv.mp4
ImageLink
↧