Unity2D, my player crouches inside a collider(is trigger)

Updated on February 7, 2019 in Answers
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
4 on February 3, 2019

So I use CinemaMachine for my camera movement so my camera doesn’t go outside the map. In order to do that I had to make a Polygon Collider2D, where the trigger is on, over the whole map. After I’ve done that my player crouches inside the collider and he is allways grounded(Meaning i can jump how much I want), Im pretty new to Unity and I can’t find any solutions to this problem. Any tip would be helpfull.

  • Liked by
Reply
3 on February 4, 2019

Can we see your script(s)?

on February 5, 2019

Its the script from Brackeys video Movement in Unity that I downloaded.

https://github.com/Brackeys/2D-Character-Controller

I tried also removing  crouch from the script to see if it fixes the problem, it only fixed the movement but the jumping was still a problem. 

Wise
on February 6, 2019

I think it’s because of the extra collider you added. If it covers the whole map, then the player always thinks they’re touching something. So they think they’re still grounded.

See what happens if you disable the collider.

on February 7, 2019

Yea it works when I disable it but shoun’t I be able to work in colliders, and how would i switch scenes later on, as I saw you need a collider to do that.

Show more replies
  • Liked by
Reply
Cancel