- Home /
[2D] How to make player face camera when rotating?
I wanna make a rotation feature like this:
but mine looks like this lol
I don't want the player to be rotated because the game is multiplayer and to other people the player looks upside down when they're rotating
Good day.
I dont't get exactly how the player moves... Relative to the camera, it does not rotate whn moving, but it rotate when shooting...
Anyway, you need to make the player rotate with the camera, so you need know the rotation of the camera to set the players rotation.
Please, provide the code you have. It will be easier to help you fixing it (Edit your question and copy-paste the code and format it using the [101010] button)
if(Input.Get$$anonymous$$ey($$anonymous$$eyCode.E))
{
transform.Rotate(new Vector3(0,0, -1));
}
if (Input.Get$$anonymous$$ey($$anonymous$$eyCode.Q))
{
transform.Rotate(new Vector3(0, 0, 1));
}
You can try to simply make the player a child of the camera so it rotates with it
if i do that won't the player look upside down for other players in multiplayer
Answer by RuralPlayer · Jun 20, 2018 at 05:45 PM
Have you tried creating a controller, attaching it to the player and attaching the camera to the player?
Your answer
Follow this Question
Related Questions
Enemy Rotation Problem 1 Answer
Side scroller - rotate object towards player. 1 Answer
Start Coroutine after other has finished 4 Answers
Random smooth rotation on z-axis every other second 2 Answers