

HoverEffect.MouseLeave:Connect(function()
COOL SCENERY CODE
1, true) - The code that makes the mouse move HoverEffect:TweenPosition((originalPosition + UDim2.new(.015, 0, 0, 0)), "Out", "Sine". PlayButton.TextColor3 = Color3.new(1, 1, 0.498039) - Adding a color whenever the player hovers over the UI HoverEffect.MouseEnter:Connect(function() Local originalPosition = HoverEffect.Position Local function Hover(HoverEffect) - Make function for it to move a bit.
COOL SCENERY FREE
Local MoveVector = Vector3.new(()/Scale, -()/Scale, 0)Ĭamera.CFrame = DefaultCFrame * CFrame.Angles(math.rad(MoveVector.X), math.rad(MoveVector.Y), math.rad(MoveVector.Z))Ĭamera.FieldOfView = 83 - Setting the FieldOfView, you're free to customize this however you want toĬamera.CFrame = - This is where your camera is, and the "CameraPart" is what my part is called.Īfter we’re done with the camera, we have to do the UI, this should be quite simple, and feel free to customize it! Scripting the GUI! Game:GetService("RunService").RenderStepped:Connect(function() - Getting the service known as "RunService" Until Camera.CameraType = - And this line is telling the game that if the Camera is set to the Scriptable property, then the loop ends. Repeat wait() - We made the loop so the camera will be set to the Scriptable property.Ĭamera.CameraType = - The line of code in which we tell the game that we need the camera to be set to the Scriptable property. Now, let’s do the camera script, I want my camera to slightly pan whenever the cursor moves, I also want it to face the scene. LockCharacterScript script.Parent:WaitForChild("HumanoidRootPart").Anchored = true Meaning, they can’t fall off the map, also make sure to add a SpawnLocation and make sure it’s transparent or at least hidden. This is a script that makes sure the character’s HumanoidRootPart is anchored, this is so the player cannot move. First of all, let’s a LocalScript inside of StarterCharacterScripts, name them however you want to. You’re free to adjust this code however you’d like to. Since the variables can’t create the code themselves, we have to create it ourselves! First, let’s start off with the camera. Local TweenService = game:GetService("TweenService") - Calling the service known as "TweenService"Īll of these buttons are in the UI, so make sure you did the previous steps before doing this one. Local StoreButton = Background.StoreButton

Local CreditsButton = Background.CreditsButton Local PlayButton = Background.PlayButton - Now we do the same with the other variables. Local Background = script.Parent - We indicate what the "Background" variable means and what it is. Local DefaultCFrame = - This variable is our part's position Local Mouse = :GetMouse() - Getting the mouse Local Camera = workspace.CurrentCamera - This what the "Camera" variable is and what it means Local Character = Player.Character - This indicates what the "Character" variable is Local Player = - This indicates what the "Player" variable is. Scriptingįirst of all, let’s create our variables! You can freely customize your variables and name them whatever you want to! - Variables Make sure that it’s anchored and can collide is off. Then, insert a Part into Workspace and name it something, I’ll name it “CameraPart,” make sure that the front of the part is facing your scene. Let’s start off by inserting a LocalScript inside of the UI’s Parent. Now, let’s get to the scripting of the UI! This should be rather simple.
