- Home /
Snake Movement Like in Snake vs Box
I am stuck at achieving snake movement of game Snake VS Box. can anyone help me.
Answer by TheReEvolutions · Jul 10, 2017 at 05:11 PM
They might be using a trail renderer to achieve the effect, Try checking
You change the whole material.
https://docs.unity3d.com/ScriptReference/Renderer-material.html
or just change the texture using Renderer.shared$$anonymous$$aterial.
https://docs.unity3d.com/ScriptReference/Renderer-shared$$anonymous$$aterial.html
You might also need to change the trail renderer length according to how many dots its has.
https://docs.unity3d.com/ScriptReference/TrailRenderer-time.html
or just have 10 trail game objects all with different amount of dots and then just switch thew them depending on how many dots you need to have .
https://docs.unity3d.com/ScriptReference/GameObject.SetActive.html
Answer by WinterboltGames · Jul 08, 2017 at 02:31 PM
you can a use a CharacterController and detect the input axis and then use the function CharacterController.Move() to make your snake moves and if you make you question a little bit more clear I would help you out more.
this is video of game. https://www.youtube.com/watch?v=8s3zdyrhvJQ
snake moving is like mechanical snake, but i don't know how to achieve that movement
in this one parent dot, others are child dots and they follows parent.
make a list of Vector3's that represents some points in the local space (the gameObject's space) then make parent gameObject move using a character controller (as mentioned above) then try to Slerp() the child object positions using a for() loop and that's it. hope this helps you
Your answer
Follow this Question
Related Questions
Set targetjoint2d anchor position at mouse position in 2d 0 Answers
Set connected Rigidbody 2D to a WheelJoint2D via script. 0 Answers
How to make Two colliders, don't collide, but still be able of interact with each others 2 Answers
How to prevent colliders from intertwining when using DistanceJoint2D 0 Answers
How can I move an object to a (0,0) and scale it to (0,0) at the same time? 1 Answer