The most important functions are in the description!
https://www.roblox.com/library/7469828078/RTSCameraModule
https://www.roblox.com/games/7506867798/RTS-Camera-Module
Basically, it allows you to make an RTS camera and manipulate it easier.
Before it’s going to be posted in community resources, i would like to get a review of this module.
Important functions
PrintProperties() - Prints and returns Properties
Update() - Sets your camera position, orientation, relative to stored position and xrotation, with yrotation.
SetCameraAngles(X,Y) - Sets your camera angle to X and Y in common degrees
SetCameraPosition(X,Y,Z) - Sets your camera point position to X , Y and Z
UpdateCameraAngleInDegrees(X,Y,DeltaTime) - Adds X and Y to stored x and y rotations. You don’t need to add a DeltaTime from now.
SetZoom(Zoom) - Sets zoom value
SetScriptable(IsScriptable) - Allows to ignore a warning, if the camera type isn’t scriptable
SetXClamp(Xmin,Xmax)) - Sets max and min angles for x axis in the camera
SetYClamp(Ymin,Ymax)) - Sets max and min angles for y axis in the camera, but it requires YRotationLimit to be true.
To set YRotationLimit to true or false, use
SetYAngleRotationLimit(IsLimit) function.
Less important functions
GetActualZoomWithWhiteList(WhiteList) – has no actual functionality yet. Returns ZoomOut value for now.
Move functions
MoveForward(Speed) - moves camera point forward on z and x axis (y axis is being ignored)
MoveBack(Speed) - moves camera point backwards on z and x axis (y axis is being ignored)
MoveRight(Speed) - moves camera point to the right on z and x axis (y axis is being ignored)
MoveLeft(Speed) - moves camera point to the left on z and x axis (y axis is being ignored)
MoveUp(Speed) - moves camera point up on y axis from world’s orientation
MoveDown(Speed) - moves camera point down on y axis from world’s orientation
MoveUpRelativeToCamera(Speed) - moves camera point up on y axis from camera’s orientation
MoveDownRelativeToCamera(Speed) - moves camera point down on y axis from camera’s orientation
EnableAnchorPoint(Enabled) - enables camera to be set to anchor point
SetCameraAnchorPointY(Y) - sets Y anchor point
InvokeCameraAnchorYPoint(Blacklist,TerrainIsCubic,readingWater) - raycasts to return true Ypos
Here’s an example script
local CurrentCamera = workspace.CurrentCamera
local Module = require(script:WaitForChild("CameraModule_RTS"))
local Sensitivity = 10
local Zoom = 40
wait(2)
Module:SetZoom(Zoom)
Module:SetCameraAngle(10,0)
while true do
local Y = Sensitivity
Module:UpdateCameraAngleInDegrees(0,Y,wait(1/60))
Module:Update()
end
robloxapp-20210918-1214301.wmv (3.3 MB)
Saddly i couldn’t upload the mp4 version
After the anchor point update
robloxapp-20210918-1300400.wmv (3.2 MB)