- Home /
World of Warcraft Camera
I been working on this online game, and I been trying to make my camera work like the one in world of warcraft, I know a little bit of code. like how to make the camera follow the player, but only thing I'm not sure about is when you hold right click to spin the camera around your character.
Plz help.
Answer by Cherno · Oct 07, 2014 at 09:05 PM
You best create an empty gameObject, and make the camera a child of it. Then you make the empty GO a child of the player, and set the local position to 0,0,0 (so it sits exactly where the player object is).
Then you move and rotate the camera the way you want (probably to the back, looking at the player, and rotating it slightly downwards).
Now, everytime you want to rotate or move the camera, you can jsut move and rotate the empty GO instead and the camera will always stay in the right position and rotation (relative to it's parent, of course).
If you want to rotate the camera around the player when a button is pressed, you would check for it in the Update() function and then rotate the empty GO accoding to the relevant mouse axis (horizontal, I guess).
Check the Unity API for further information.
http://docs.unity3d.com/ScriptReference/Input.GetKey.html
http://docs.unity3d.com/ScriptReference/Transform.Rotate.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613164613im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
World of Warcraft Camera 2 0 Answers
Unity MMO Controller Example - How to Reposition Camera? 0 Answers
How to make camera position relative to a specific target. 1 Answer
Can someone modify this for me? 0 Answers
Camera Help (WoW-like) 1 Answer