0
\$\begingroup\$

I'm making a 3D endless running game like subway surf. When I swipe/press down arrow the slide animation starts but the capsule collider isn't following along as it doesn't slides along with the character. Searched a lot on this on the forums, one possible answer is to attach the collider with some bone. I tried doing so, but couldn't make it. As I'm fairly new to Unity please provide some insights to how to overcome this situation. Here are the screen shots of the collider not following the sliding animation

Image 1- Run Animation starting

Image 2- Sliding Animation Running with capsule collider standing uptight

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

I used a trick instead, just in case anybody else also has a similar problem: when the sliding animation starts I change the character controller's dimensions to just fit the slit. As soon as the sliding animation is over I reset the character controller's dimensions back to normal using the invoke method.

\$\endgroup\$
1
  • \$\begingroup\$ That's also what I would have done in an endless runner. In this genre you want full control over your hitboxes to keep the game predictable. \$\endgroup\$
    – Philipp
    Jan 5, 2016 at 11:41
0
\$\begingroup\$

You could try animating the collider as well.

\$\endgroup\$
3
  • \$\begingroup\$ I'm not aware, how to accomplish that; any help would be grateful. \$\endgroup\$
    – Ashish
    Aug 10, 2015 at 21:30
  • \$\begingroup\$ Does your character have bones? \$\endgroup\$
    – John Smith
    Aug 11, 2015 at 7:17
  • \$\begingroup\$ Actually I'm not sure, as the character I'm using is 'Robot Kyle' which I downloaded from Unity Asset Store. I'm new to Unity and particularly not involved with character design and animation. \$\endgroup\$
    – Ashish
    Aug 11, 2015 at 15:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .