/
/
/ "BRO TIGER"2017-08-16 08:05:34
C++ / C#
/ "BRO TIGER", 2017-08-16 08:05:34

How to shift the position using Child objects, thereby shifting the position to the Center?

Hello! Not so long ago, about a month ago, I came across an interesting Asset in the Asset Store, called "Fast Bouyancy"... This is water physics that I really need for the game, and more realistic than the self-written version! I wondered how to change the Center of Mass as the player adds details ...
Here's how it's called:

floatingGameEntityFlat.centerOfMassOffset = new Vector3(0, 0, 0);

As you can see, this is a variable inside the class that has the Vector3 type ...
Since all Physics is embedded in the Parent, it is necessary to shift the "Center of Mass" with the help of Child objects, but I have no idea how ... If there is not enough information, please contact me, I will add ...
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2017-08-16
@BRO_TIGER

https://docs.unity3d.com/ScriptReference/Rigidbody...
I don't know if this link will help you, but I suspect that floatingGameEntityFlat.centerOfMassOffset simply overrides this here)
There is also a method that forces the Rigidbody to recalculate the center of mass, but it is considered trite on the basis of the geometry of colliders, from which the object is "blinded"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question