- Home /
Rigidbody deforming after being hit.
So I am programming a VR game I have some books on a bookshelf and when a player knocks them off they resize themselves on occasion.
This is the GO with the RB attached:
https://gyazo.com/2e8d5931520240a4f0a4739c6a3a6769
This is the Same GO that is deformed: https://gyazo.com/9991f72c288535250ca66fe1b59862d2
I read somewhere that it could be because it is a child of another GO... But I want to instantiate a segment of room with a bookshelf and the books are on the bookshelf is there a way to do this or do I need to make a script to unchild them om awake or something? I'm not sure I understand why this is happening in the game so any advice is appreciated.
If you have an oculus AND TOUCH and want to give it a go and have a look for yourself you can download a copy of the game here: https://www.dropbox.com/s/t7v35jvt9xyyq3r/Into%20The%20Depths%20V0.0.5.2.rar?dl=0
Answer by Defetysta · Feb 18, 2019 at 09:28 AM
Try to spawn them inside of an empty game object, I had simmilar problem and this hotfix helped me.
Seems to work I made a group and called it bookshelf books put them there added that GO to the prefab and no more weird distortions. Do you know why it does this it seems kind of odd to see random deforms without any clear cut reasoning?
I'm not any pro in Unity, but my guess is that the previous parent scale wasnt "a cube", what I mean is that it's x, y and z scale were not equal. So when the child was spawned, it tried to get (1, 1, 1) scale, which was distorted because of the parent's scale. I've tried to reproduce it now by making an empty object, changing it's scale, then creating a cube and putting it as a child of the empty game object, and it got distorted. Then, I've created an empty gameobject, put it as a child of that first parent, then create a cube and put it as a child of that new empty game object, and it seemed to work just fine.
Your answer
Follow this Question
Related Questions
Parenting messes with my rotated cylinders 1 Answer
deformable colider 0 Answers
Mesh Deformaion? 0 Answers
Why can I not affect terrain height? 0 Answers
How to deform a mesh at runtime? 0 Answers