dimanche 30 avril 2017

Moving behavior of following gameobjects in Unity

I’m trying to clone this arrow game from ketchapp which I don’t intend to publish, I’m only doing it for learning purposes so don’t hate me for that. Anyway I’m using Unity and I’ve programmed the controller which is attached to the head, and the tail parts have the script which tries to follow the head. But the tail parts are not following in a desired behavior like they do in the actual game. I’ve tried spherical interpolation (slerp) and smooth damp (vector2.smoothdamp) for the follow like positioning of tail parts, but it’s making a curvy pattern (which it should because it’s slerp and smooth damp) when the head moves left or right which is not what I want. In the actual game the tail parts move exactly in a way or in a pattern the head moves. I’ve thought of storing the transform of head, and then making the rest of the tail parts follow through them but that doesn’t seem like an efficient approach at all. So how should it be approached? I’m attaching images from the actual game and my work so far.enter image description here

Aucun commentaire:

Enregistrer un commentaire