Search code examples
c#unity-game-enginevectorgame-physics

Rotating 2D world within Unity


I am looking at developing a game within Unity by using C# The game will take the gyroscope orientation and rotate accordingly to the direction of which the phone is rotated.

I am curious of how this would work, I understand how I would be able to read and update the gyroscope orientation however I am unsure on how to assign this to a world to rotate. There will be a player on world which will be the next challenge to prevent the player clipping through the world when it is rotated. Hence the world should rotate around the players current location.

I currently have no code as I am in the process of designing this, however i am unable to get the logic of how to make this work within my head

Thankyou


Solution

  • If I get your objective right, I guess rotating the camera like in a Fist-Person game should be enough, and would be way simpler than rotating the whole world while keeping the player static.