unity3d - My GameObject's transform won't rotate through 360 - "pingpongs" between 270 - 90. (Unity 3D C#) -
Sorry in advance if it is difficult to comply, then I need to draw a diagram when I need it.
I am using Unity 3D to develop a game and I am having trouble in the player's adaptation. The game is the first person, 3D, and there are points where the gravity will change, the player will be allowed to walk with a wall - it's all up and running.
When the severity of the players is such that it moves on a wall, when I behave strangely to rotate the character to see its result, it can rotate through a full circle and There are no visible problems with the character while playing the game.
If I look at the Inspector in Play mode, suppose I am continuously correcting, the following happens:
- Rotation rises to 90 degrees < / Li>
- As soon as it reaches 90 degrees, it starts returning to 0 in the opposite, as I have changed direction
- Then it counts the last 0 and Moves up to 270 - Once it hits 270, it starts counting back again, increases to 90, and so on. Mr. sought. The other axes now only change from 0.00001 degrees, but they stay around their value (this is the same on the ground and it rotates properly, so I do not think this is a problem).
The sequence will be something like this: 0, 1, 2 ... 88, 89, 90, 89, 88 ... 1, 0, 35 9, ... 271 , 270, 271 ... 35 9, 0, 1 ... 89, 90, 89 ...
etc.
When I see the changes in the visual scene, it's a wiper on the car window as front and back, but when my character is constantly changing in one direction. When I'm on the ground, it circles completely as it should be, even though the value is still "ping-ponging."
What causes it? It does not happen when the player's character is on the floor, only when he is on the wall, I need to know because of this because there is something else in the game that depends on the player's copy of the rotation, and this problem She is giving the behavior that I do not want.
Any help would be greatly appreciated, I had trouble with this for a while!
You should not rely on angle values, unity, it uses quartiles for rotation: / P>
Strange behavior has come from the fact that angle values of many angles are represented by the same rotation.
Comments
Post a Comment