Hello! I wanted to make a tutorial that covers the basics of proximity prompts, as well as some cool things to do with them.
What is A Proximity Prompt And where can i add it in game?
Well, a proximity prompt is a prompt to interact with, for example, pressing e could start a natural disaster, or do something as small as make a duck fly. It activates anything you want it to.
To add it in your game, and this is necessary since were going to work with this, you can find it like this:
Press the “+” button while hovering over workspace in explorer.
Add a part.
Then, press the “+” on the part and look for a proximity prompt.
You can go inside your game to see you can interact with it, but it won’t do anything yet. So, let’s make it work!
Scripting the proximity prompt.
Alright, 1st thing we are going to do is make it where if activated, another part in the workspace will be slightly invisible.
1ST: Add a script in your proximity prompt. Plus, add a part and name it “Part2” in workspace.
2ND: Write the following code.
script.Parent.Triggered:Connect(function()
script.Parent.Parent.Parent.Part2.Transparency = 0.6
end)
Before we do anything else, let me explain what’s happening here.
Basically, script.Parent
is your prompt.
When that prompt is Triggered
, it will make the part invisible.
Lets test it ourselves.
Look! Now the part is slightly hard to see!
There is so many other cool things to do with these, so I’ll leave some cool things for you to try out.
Thanks for reading my tutorial! I hope you learned something.
Open UI With prompt
Alright, so the 1st things were going to do is add a ScreenGUI in StarterGUI.
Next, add a frame inside, and drag it to the middle of the screen.
Then, select ScreenGUI, and look at its properties. Turn Enabled off.
You may have noticed the frame.disappeared. That’s ok, that’s what its supposed to do.
Now, lets enter a local script in our ScreenGUI, and write the following.
game.Workspace.Part.ProximityPrompt.Triggered:Connect(function()
script.Parent.Enabled = true
end)
Now test out your game, and it should appear!
Prompt Activated Dummy Animations (COMING)
This text will be hidden