How can I make a series of actors follow one another precisely?
Yesterday I posted this question trying to learn how to make my SnakeBody class follow my SnakeHead class in my Snake clone. Today I'd like to see if anyone has any suggestions on how to implement an alternate method. I saw this video of "Pix the Cat" and I'd like to see if I can get the SnakeBody instances to follow my SnakeHead player, much the way the ducks follow Pix the Cat. I'd like to dynamically add SnakeBody elements to the SnakeHead, or even subtract them if I decide to add powerups/powerdowns to the game.
Is there any easy, elegant solution I'm missing on how I can get actors to follow the player precisely, following the exact path the player has taken?
asked Oct 12 '14 at 12:37 AM in Blueprint Scripting
Well, there are two quick solutions I see: One, use physics constraints (https://docs.unrealengine.com/latest/INT/Engine/Physics/Constraints/ConstraintsReference/index.html), which will allow you to chain all of your actors together and move as a group.
Since you are specifically referencing 2D gameplay however, I think you might get more out of solution Two: Maintain a history of points that you (the head) have traveled, and have each child actor follow them in turn. This is especially easy if you use grid constraints like the video you have there (basically, you just need to store off your grid node history).
answered Oct 12 '14 at 12:56 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here