Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Help with camera movement (REDONE)

Discussion in 'Scripting' started by shAen1234, Jul 15, 2019.

  1. shAen1234


    Jul 12, 2019
    (Well I know I already posted something like this but it didn't really get any help and was most likely very confusing, I redid it with more information to be more clear)

    I need help with programming some camera movement but it's a little different, I'll explain;
    Right now I am at ep 11 of Brackey's multiplayer FPS but just in the first few minutes of the video, so nothing significant is going on. I already have a crosshair made and in the game that enables and disables upon joining and exiting a server (Using the Unity Net thing), but I would like to have this crosshair separate from the rotation of the camera and just be facing where the robot is facing. I would like the mouse cursor to act as a pointing device and have the camera and a circle-esque GUI element be locked to it (and the mouse cursor be invisible). The robot would point towards the cursor but there would be a delay where the robot would "take time" to get to where the cursor is pointing. I know my explanations are really confusing but I'm trying to turn the ideas of the game (and try and learn C# in the meantime) into my own so I'm not directly copying him. I know that might be complicated but here's the TLDR, for those who know War Thunder, that's the camera mechanics I'm looking for. If you don't know what it is here is a video;

    You can see even from the beginning how I want the camera to work, although it can look confusing because the tank is moving but the idea of the system is there. If you skip to 7:30 that's a good demonstration.

    Although I found a youtube video already containing a GitHub page with some code, it isn't exactly what I want because it's simulating a plane and there is roll and he is controlling the plane with WASD, but I would only like directional movement. Here is a link to that as well;

    Now, if somebody could help me redo some code within that GitHub project to fit the style of how war thunder has their movement system set up and how I would like it with my ideas (I'd be fine sharing all the files and code so people don't have to go around finding it themselves) it would be super helpful. I am a complete beginner to C# and I am really just following along with Brackey but I do understand some functions, so you might need to explain it very blatantly.

    Thanks a lot if anyone helps.