#How to make a head that reacts to collisions?

1 messages · Page 1 of 1 (latest)

stable siren
#

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?

random pecan
#

Active ragdoll might be what you're looking for

stable siren
# random pecan Active ragdoll might be what you're looking for

Yea, I wasted some time with puppetmaster but it's unviable cause it's too shaky and jittery. I just couldn't make it work.

I haven't tried doing it only for the head. It might or might not work but I wanted to try and not do that because puppetmaster fucks up my hierarchy and I have to change some of the code. Still, it might be viable

random pecan
#

Active ragdolls are completely customizable, you can attempt to remove the jittering by adjusting spring and stiffness values

stable siren
#

By making a puppet head that's a spring on a stand

#

And move the stand via forces towards the head model

#

That's how puppet master works in essense