hello, I am a beginner in unity so I really don’t know a lot. I want to have a camera that follow the player like the one in this video : Super Mario Style Platformer Game (Unity3D) - YouTube
I tried to follow one tutorial and use the MultipurposeCameraRig, but it only show the player back it doesn’t let me see the player face when rotating. its like attached to the player back. any tip or tutorial ?
1 Answer
1You need a camera attached to the player, and use Transform.RotateAround()
private GameObejct _cam;
private GameObject _player;
void Update()
{
int x = Input.getAxis("horizontal");
if (x == 0f)
return ;
Vector3 axis = (x > 0f ? Vector3.right : Vector3.left);
_cam.transform.RotateAround(_player.transform.position, axis, x * Time.deltaTime);
}
I guess something like that would work !
No it shouldn't. Unity is a game development engine, not an emulator. And besides, an XboxOne has a faster processor and more available RAM than my development laptop; so, if I set XboxOne as my target platform, how is Unity going to test my game with more resources than my machine actually has....?!
– tanoshimi
So do you want your camera exactly like that ??
– Abhiroop-TandonI mean PC Windows platform.
– Rardok