Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Best way to control or manipulate camera?

Asked by
8oe 115 Donator
4 years ago

Hey there.

I had the idea of making a game similar to clash of clans on Roblox.

I wanted to make a camera that simply could rotate fully around the top I suppose of the map. In the best terms, I would like to have the camera similar to that of clash of clans except with a little more rotating or movement to the camera.

Now I do not expect any code as an answer but rather guidance on how to do so and what to do with the camera.

If I may explain myself, the camera is what would be rotating around the top of the map will have limitations of not allowing it to to go under the map or I suppose 300 degrees less than the map itself as an example. I did have the idea of using scripts to solve this issue yet I don't have necessary experience with using these cameras to manipulate what the players can see without using the character I suppose.

My first idea was using a part in the center of the map and setting the camera of the player to that part in which the player would see everything around it. I could also set the maximum and minimum zoom of the camera to a number that would not allow it to fully zoom in but rather to a certain distance. However I don't know how to necessarily set limitations on the cameras rotation to not go to a certain degree in which I haven't necessarily decided yet but if the camera may or may not be able to. I also had to idea of being able to move the part or camera somehow when clicking and moving the screen which I suppose you could use UserInputService, mouse to move the part around which also contains the camera I suppose. As well as when zooming into the map it's more smooth then it would for Roblox's current type of system in my words. The angles to camera I will attempt to find out myself with experimentation.

Now this is the best thought I have had into the camera and yet I have not been able to find an answer to this problem I have.

I don't personally have photos of the camera but if you search videos of the game on google you find that when players are playing they can use two fingers to zoom in and out however I'd like to modify that using the scroller and mouse. I have googled and found some gifs that may help explain what I am looking for.

Zoom Movement

I do hope I explained myself enough.

0
One suggestion I have is to use math.clamp to set minimum/maximum camera zoom User#32819 0 — 4y
0
Thank you, I will make sure to use math.clamp! 8oe 115 — 4y

Answer this question