How to make trail effect?
-
I’m wondering how to make objects follow each other with the function to add and subtract objects(making a trail like slither.io)
-
For each time an object moves another object can move the same amount of units up, down, left, or right?
-
Yeah but how do I make it so I can add more in game.
-
What do you mean?
Just put all the regular behaviors, and when you do something to move the object or set a velocity or whatever, tag the object and the objects that are following it to move together.
-
What do you mean?
Just put all the regular behaviors, and when you do something to move the object or set a velocity or whatever, tag the object and the objects that are following it to move together.
@GameCRAZY that wouldn't make a trail, they'd all move the same way. The easiest way I think is to use an array the length of the trail, every time the main object moves add its position to the front of the array and delete the last one. Start the array with the starting positions of the trail. Whenever you move, each part of the trail moves to the relevant part of the array.
-
Pivot Joints.
Head (first circle) has a pivot joint some percentage from its centre towards the direction of the tail. Place the pivot joint here, attach the tail circle at this point, to its centre. Each subsequent tail section attaches to its "parent" at a point on the parent the same distance from the centre that was used on the head, in the opposite direction to that of the current movement.
Some maths required to figure out where that is, math that is far beyond me.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login
