Scale ragdoll character after collision in unity

501 views Asked by At

I have a 3D ragdoll character and it collects coin like objects in game. I want to re-scale this character onTriggerEnter(). After scaling character, the character joint component is not updating therefore it looks like glitchy. I added script to "Player" gameobject in a game and I'm trying to re-scale "Player" gameobject's localScale and also tried in "Bone" gameobject

  • Here is my hierarchy:
  • hierarchy-screenshot
  • This is my script:
  • scale-script
  • My question: Is there any alternative way to scale my character through script?
1

There are 1 answers

0
Jamwit Karimov On BEST ANSWER

After long time I found the solution, the problem was with CharacterJoint component. It works only on start and not updating when you did change on Character, So I cached CharacterJoint's anchor values and I updated it on every change. Something like this, also many thanks for Richard