- Home /
Physics related rotation problem. (a weird one)
Hello guys,
Im working on a topdown scrolling space game. The physics were working just as intended until now. I implemented a database and started instantiating the objects i previously added from the hierarchy.
I rotate my ship with addtorque, and the pivot points of the ships are exactly in the center, so they rotate around the precise center. The problem is, if i instantiate a ship in runtime, its center seems to change slightly. It rotates around a point very close to the center but not the exact point as it should be. It doesnt matter if i instantiate the object from editor or within the code, if i instantiate it during runtime, it doesnt rotate properly. Rotating around the wrong point also changes the position of the object. When i use the same prefab and create an instance of it before running the game, it works perfectly when i run it.
Im guessing instantiating somehow screws the center of rigidbody. If i stop the game and try to rotate by using the editor, it works fine, so i assume that the problem is not about the pivot changing. I think it is about the physics engine somehow deciding center of the object is different than the pivot.
Any ideas?
Your answer
![](https://koobas.hobune.stream/wayback/20220613113645im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Freeze object rotation on Polybrush 1 Answer
Instantiated Object looses prefab's rotation 10 Answers
The bullet only moves in one direction and does not rotate with object. Code: 1 Answer
A way to instantiate an item with 90 Degree increments? 2 Answers
Thrown objects always have same rotation 2 Answers