I want my character to be able to bump his head and then move it the opposite way.
I understand I can raycast or have collision checks etc. but I struggled a bit there, probably because of various rotations and such.
The players crawls through tight tunnels so sometimes it's hard to tell what's what.
For example, if I detect a collision head on to duck, player will do it when there's a closed wall in front of him and I don't want that.
I also had 2 rays, one higher and one lower. If higher hits and lower doesn't, he ducks. Logic is, it's just a lowered ceiling and not a closed wall.
But often this just didn't work for some reason.
For forward movement, ideally I would have anticipatory ducking where the player ducks before he hits (i.e. head collider is elongated I guess). For the sides, it should be normal.
Probably it would be best if I could make the head a rigidbody with a spring so that it returns naturally when it can, but is it possible to do that if my char controller isn't a rb?