Monday, December 23, 2024

Top Down Tank Tutorial: Camera Controls

 

    Second bit of the tank tutorial, let's talk very quickly about how the camera is controlled. So, first of all, the camera isn't free floating or attached to the tank. It's instead attached to an empty object that follows the tank around, which let's me also detach it and move it around to see points on interest. 

    The empty object has this little bit of script that keeps it over the player when it isn't going after a point of interest. Every frame (On Update Block) the script grabs the position of the player (in this case called Player_Head) and sets its own position to match. Pretty simple.

    Then we have rotation controls. Anyone who read the last post will recognize these as copies of the rotation controls from the tank, but linked to the Q and E keys instead. Again, using rotation based on the self in the Rotation block. 

    I know this tutorial was a bit short, but the camera controls aren't all that complex, and do they really need to be?

     That's it for now. Come back soon to lean more about how this tank works. Maybe throw me something on Ko-Fi and I can justify making some more Visual Script write ups. I have a lot of other half-baked scripts to share.

 

 

No comments:

Post a Comment