i found the name of your channel in the comments of a roblox studio video that was the best discovery i have ever made it is really interesting to see how this minimap is made and why is it made like this you are literally one of my favorite youtubers now. no joke
clip decedents and rotating GUI do not work together unfortunately so you would have no choice but to use the full viewportframe and always update the viewports camera so you would not be able to use the optimizations I show in this video if you want to rotate the minimap :(
@@5uphi Ahh glad you told me, also my game has a custom first person that moves as the mouse is moving how could I fix my player's position on the map because it goes normal when I return to third.
thanks a lot for explaining everything in detail, you deserve more followers! keep up the outstanding work! also can you make a working blade with very good hitbox mechanics thx alot!
Bro I think I just found out that you have a bot that writes the stuff for you. I hear you making some combination on your keyboard to start it. If I'm wrong, you're probably holding Ctrl+Y or Ctrl+Z or you're typing is just perfect. Keep up the good work btw
So I've seen the comments about terrain and how the solution would be to represent terrain via parts, but couldn't I just take a screenshot of the entire map from above or draw it and then put it onto the frame while still having the character walk on it?
the viewport should go outside the frame but when you enable ClipsDescendants it should hide the parts outside the frame but if you rotate the frame then it wont hide it so make sure the rotation is set to 0
This is great, but I don't imagine this scaling well. For my old map system, I used the RoRender plugin to render the map to an image and used a similar concept for moving the image around based on the player's position. However, I am revamping many parts of my game, including this system. And while it worked fine before, it does come with the caveat of re-rendering the map to see changes. Any suggestions on large-scale maps?
Use content streaming with child/descendant added and removing to detect when instances stream in and out to update the map this will allow you to reduce the amount of instances you have in your map th-cam.com/video/d8pqcfxqmek/w-d-xo.html
@5uphi Thanks for the reply. I was planning on using content streaming anyway, but it does seem inefficient to be cloning and destroying parts. I'll have to give it a try and see if it's negligible.
Ye ehm I think I'm quitting this idea it's a great video and I suppose it'll help others real good but I've been searching 40 min+ and still can't find what I've done wrong I have read the script over 3 times to check for any spelling mistakes, Upper/Lower Case and just about anything I just can't find it...
It might be because content streaming is enabled so when the player enters the game the folder has not loaded yet so nothing is added to the folder You can use child added and child removed to detect when the things are added to the folder to add them to the viewport
Thanks for the tutorial. At 5:00 when you run the local script it loops all the objects in the Map folder and clones them into your viewport frame, but when I do it nothing happens because it runs so fast that it loops before any objects can be rendered into the game in the map folder. Why do I have this problem and you don't? Also is there a solution to this problem other than adding a simple wait before I run any of the local scripts code?
so i copied everything exactly, and for some reason when i walk, the image jumps instead of a smooth transition, and doesn't seem to align with my characters position at all times. i added different parts into the Map Folder but still same result.
@@5uphi i looked over the code many times, i checked the gui, i even changed every single thing in the gui and tried to see how it affected it and still nothing. Edit: whats even weirder is when i copy the minimap system into a different game it works Edit2: The issue happens when the parts are further away from the worlds Y axis. In Order to Fix this i just changed the workspace's Y Position
Can you make a Pistol with recoil and cool effects that damages a player? Also, I found your channel yesterday and I am so glad I did, I made a cool car thanks to you!
Thank you for the tutorial (i wish you made this a few months ago when i had to make my own minimap script and i am not willing to rewrite it now :P, was to much of a hassle ), but still got some nice ideas from this tutorial. I wonder if your minimap system works well with "SteamingEnabled"?
The viewport updates as you move from chunk to chunk so if the parts have been streamed by the time you enter a chunk it should be in the mini map or you would need to force update the viewport when a new item gets added
I'm really confused because of the first part of the localscript. I have a map with multiple folders inside to count for other uses, so does that not work? When I run my game, the viewport is not there at all. It is just a completely white screen on my minimap.
It's down to you to decide what parts get cloned into the viewportframe if it's completely white then it's most likely that your not cloning anything into the viewportframe so it's just a empty frame
@@5uphi This makes sense, because of how you coded it, but I copied every instance underneath the "OldMap" folder (which is what i'm referring to as my map folder). Would it clone everything inside a child folder from "OldMap", such as a Folder inside called "Walls" or "Trees", as an example?
This is mostly likely because content streaming is turned on by default now You need to use childadded to detect when a part streams in you can also use a model with streaming set to persistent I have a video on content streaming if you need more information
Because when you move the camera the viewport has to render the texture again so if you have 100000s of parts in your viewport its more optimal to move the frames position but you don't have to do it this way if you like you could just move the camera
@@5uphi Ah, I thought so. So as long as we don't change anything in the viewport (such as the children/properties/cframes or whatever) the viewport will cache the texture instead of re-rendering every frame
@@5uphi He wants it to rotate on your perspective as well. You could do this by rotating the top down-view camera to be the same rotation as the player's Y orientation. Ofc this will look weird when your character is spinning
Oh well clip descendants and rotating GUI does not work together so if you wanted to rotate the mini map you would have to update the camera every frame
I think the problem your having is with content streaming when you walk the server will stream to the client but your not adding them new streamed in parts into the viewportframe you will need to use childadded and childremove to detect when parts stream in and out
Yes but because the viewport only updates when you move from one chunk to the next chunk you would have to force the viewport to update when something changes so this optimised method works best for things that are anchored and are not moving but if you want to have moving parts it might be best to just have the viewport camera update every frame and not worry about the optimized chunk system I show in this video
I was also having issues and I found that making the viewport frame 2 times as big as the frame helped solve it. Also be cautious about getting + and * mixed up. Those are the issues I had
Hey man. I've been trying to write ur script so many times but it just dont wanna work. local frame = script.Parent local camera = workspace.CurrentCamera local viewPortFrame = frame.ViewportFrame for i, descendat in ipairs(workspace.Map:GetDescendants()) do if descendat:Isa("BasePart") == false then continue end local clone = descendat:Clone() clone.parent = viewPortFrame end local viewPortCamera = Instance.new("Camera") viewPortCamera.FieldOfView = 20 viewPortFrame.CurrentCamera = viewPortCamera local offset = Vector3.new(0, 500, 0) camera:GetPropertyChangedSignal("Focus"):Connect(function() local cz = camera.Focus.Position.Z local cx = camera.Focus.Position.X local position = Vector3.new(cx, 0, cz) viewPortCamera.CFrame = CFrame.lookAt(position + offset, position -Vector3.zAxis)
end) everything is right idk why its not working. could u please send me the whole script in text ?
@@5uphi id really like to learn coding but my inconsistency is against it.. can you give me some tips and proper mindset man? :((( should i take online courses?
local frame = script.Parent local camera = workspace.CurrentCamera local viewportFrame = frame.ViewportFrame for i, descendant in ipairs(workspace.MiniMap:GetDescendants()) do if descendant:IsA("BasePart") == false then continue end local clone = descendant:Clone() clone.Parent = viewportFrame end local chunkSize = 128 local ChunkHalf = chunkSize / 2 local offset = Vector3.new(0,500,0) local currentX, currentZ = math.huge, math.huge local viewportCamera = Instance.new("Camera") viewportCamera.FieldOfView = 28 viewportFrame.CurrentCamera = viewportCamera local offset = Vector3.new(0, 500, 0) camera.GetPropertyChangeSignal("Focus"):Connect(function() local cx = camera.Focus.Position.X / chunkSize local cz = camera.Focus.Position.Z / chunkSize
local chunkX = math.floor(cx) local chunkZ = math.floor(cz)
local x = cx % 1 local z = cz % 1
if currentX ~= chunkX or currentZ ~= chunkZ then currentX, currentZ = chunkX, chunkZ local position = Vector3.new (chunkX * chunkSize + ChunkHalf, 0, chunkZ * chunkSize + ChunkHalf) viewportCamera.CFrame = CFrame.lookAt(position + offset, position, - Vector3.zAxis) end
local frame = script.Parent local camera = workspace.CurrentCamera local viewportFrame = frame.ViewportFrame for i, descendant in inpairs(workspace.Map:GetDescendants()) do if descendant:IsA("BasePart") == false then continue end local clone = descedant:Clone() clone.Parent = viewportFrame end local viewportCamera = instance.new("Camera") viewportCamera.FieldOfView = 28 viewportFrame.CurrentCamera = viewportCamera local offset = Vector3.new(0, 500, 0) camera.GetPropertyChangeSignal("Focus"):Connect(function()
Really good tutorial. The work you're putting into these tutorial videos is much appreciated by the community!
You never cease to amaze me with the new unique tutorials!
i found the name of your channel in the comments of a roblox studio video
that was the best discovery i have ever made
it is really interesting to see how this minimap is made and why is it made like this
you are literally one of my favorite youtubers now. no joke
A very helpful tutorial keep up the work 👍
Been looking for a tutorial like this for my go karting game for ages wow.
How would I go about making it spin like in racing games, like the map?
clip decedents and rotating GUI do not work together unfortunately so you would have no choice but to use the full viewportframe and always update the viewports camera so you would not be able to use the optimizations I show in this video if you want to rotate the minimap :(
@@5uphi Ahh glad you told me, also my game has a custom first person that moves as the mouse is moving how could I fix my player's position on the map because it goes normal when I return to third.
Make sure to set the cameras focus in your custom camera script
@@5uphi I'm trying to see what you mean, I never knew you could even do that. And it shouldn't mess anything up right? sry about the questions.
thanks a lot for explaining everything in detail, you deserve more followers! keep up the outstanding work! also can you make a working blade with very good hitbox mechanics thx alot!
my head trying to understand everything: 🤯🤯
migraine…
You’re better off learning Lua concepts rather than bashing your head against tutorials
Works really well! Thanks for the tutorial!
Bro I think I just found out that you have a bot that writes the stuff for you. I hear you making some combination on your keyboard to start it. If I'm wrong, you're probably holding Ctrl+Y or Ctrl+Z or you're typing is just perfect. Keep up the good work btw
Ctrl + Alt + V
@@5uphi wait its that simple?
@@5uphi it doesnt work
@@cyrusdevs his AI needs an update.
So I've seen the comments about terrain and how the solution would be to represent terrain via parts, but couldn't I just take a screenshot of the entire map from above or draw it and then put it onto the frame while still having the character walk on it?
Yes that is also an option then you don't need a viewport frame simply use a image label
hey, im having a problem to where the viewport is outside of the frame
the viewport should go outside the frame but when you enable ClipsDescendants it should hide the parts outside the frame but if you rotate the frame then it wont hide it so make sure the rotation is set to 0
This is a amazing tutorial !
Thank you
Goat youtuber keep up the good work 👏
This is great, but I don't imagine this scaling well. For my old map system, I used the RoRender plugin to render the map to an image and used a similar concept for moving the image around based on the player's position. However, I am revamping many parts of my game, including this system. And while it worked fine before, it does come with the caveat of re-rendering the map to see changes. Any suggestions on large-scale maps?
Use content streaming with child/descendant added and removing to detect when instances stream in and out to update the map this will allow you to reduce the amount of instances you have in your map th-cam.com/video/d8pqcfxqmek/w-d-xo.html
@5uphi Thanks for the reply. I was planning on using content streaming anyway, but it does seem inefficient to be cloning and destroying parts. I'll have to give it a try and see if it's negligible.
Another way is once you have finished the map take a screenshot just use that screenshot
The tuturial is amazing but im just stuck at 19:27 i can't get the chunks to update normally 😭😭
Ye ehm I think I'm quitting this idea it's a great video and I suppose it'll help others real good but I've been searching 40 min+ and still can't find what I've done wrong I have read the script over 3 times to check for any spelling mistakes, Upper/Lower Case and just about anything I just can't find it...
I can still see the viewport updating 🥲
So I rewrote the whole script and you can still see the viewportframe updating anyone know how to fix this? (Time stamp mentioned above)
It might be because content streaming is enabled so when the player enters the game the folder has not loaded yet so nothing is added to the folder
You can use child added and child removed to detect when the things are added to the folder to add them to the viewport
The speed in which you type is incredible
AutoHotKey
Marvelous work!!!
Everything works well but there is a issue
i can only the bassplate in the map and nothing else
yeah me too!
YOOOOOOOOOOOOO THIS IS ACTUALLY INSANE
I’d like to incorporate a friend system for this and remove the ability to see the “Player2” as well as make it circular
all of that is possible check out the discord for help
How can I enlarge the map and see the whole map by pressing a button or tapping on it
simply change the size of the outer frame
Thanks for the tutorial. At 5:00 when you run the local script it loops all the objects in the Map folder and clones them into your viewport frame, but when I do it nothing happens because it runs so fast that it loops before any objects can be rendered into the game in the map folder. Why do I have this problem and you don't? Also is there a solution to this problem other than adding a simple wait before I run any of the local scripts code?
You can use childadded to detect when instances get added
Amazing!
where do you get the math for this bro? like do you learn this on your own or smth
Yup I discover the math on my own
@@5uphi how
When you have been playing with numbers for a long time your power over manipulating them increases
So in short lots of practice
so i copied everything exactly, and for some reason when i walk, the image jumps instead of a smooth transition, and doesn't seem to align with my characters position at all times.
i added different parts into the Map Folder but still same result.
Something might be incorrect with your gui
@@5uphi i looked over the code many times, i checked the gui, i even changed every single thing in the gui and tried to see how it affected it and still nothing.
Edit: whats even weirder is when i copy the minimap system into a different game it works
Edit2: The issue happens when the parts are further away from the worlds Y axis. In Order to Fix this i just changed the workspace's Y Position
i have a question, can viewport frames be on billboardgui and surfacegui or is it screengui only
If I remember correctly it can
Tip: Use a noise gate on your mic
Mic problems have been fixed in more recent videos
how does this guy code so fast and smooth
AutoHotKey
Can you make a Pistol with recoil and cool effects that damages a player? Also, I found your channel yesterday and I am so glad I did, I made a cool car thanks to you!
i am trying to think of some good gun code but will most likely not be about the effects but how to make guns not exploitable
@@5uphi that’s exactly what we need, making non exploitable weapon/gun system gotta be hella useful, amazing content keep it up ❤️🔥.
@@5uphi I'm fine with that.
Recoil basically just tween the camera's CFrame
Thank you for the tutorial (i wish you made this a few months ago when i had to make my own minimap script and i am not willing to rewrite it now :P, was to much of a hassle ), but still got some nice ideas from this tutorial.
I wonder if your minimap system works well with "SteamingEnabled"?
The viewport updates as you move from chunk to chunk so if the parts have been streamed by the time you enter a chunk it should be in the mini map or you would need to force update the viewport when a new item gets added
I'm really confused because of the first part of the localscript. I have a map with multiple folders inside to count for other uses, so does that not work?
When I run my game, the viewport is not there at all. It is just a completely white screen on my minimap.
It's down to you to decide what parts get cloned into the viewportframe if it's completely white then it's most likely that your not cloning anything into the viewportframe so it's just a empty frame
@@5uphi This makes sense, because of how you coded it, but I copied every instance underneath the "OldMap" folder (which is what i'm referring to as my map folder). Would it clone everything inside a child folder from "OldMap", such as a Folder inside called "Walls" or "Trees", as an example?
if you use getchildren then it will only clone the children if you use getdescendants that it will get everything including things inside sub folders
@@5uphi Alright, thanks. That's probably where I've gone wrong.
That help alot thank you
Hey do you know if there is a way to make a mini map with terrain?
Viewportframes can't render terrain you will have to create parts that emulate the terrain
cool
so im following your video and on my end my viewport is only displaying a white screen?
Make sure to follow the video correctly
@@5uphi thank you
wait so when i re did it it doesnt send anything to the viewport frame
This is mostly likely because content streaming is turned on by default now
You need to use childadded to detect when a part streams in you can also use a model with streaming set to persistent I have a video on content streaming if you need more information
@@5uphi def would like that thank you
Brilliant
Question, would this work on natural terrain or does this only support part-made terrain?
Viewports are not able to render terrain
@@5uphi gotcha, thanks.
You could read the terrain voxels or raycast and use that to generate parts that looks like terrain but it won't be very good on performance
How can I make this work with terrain?
Raycast to find the height of the terrain then place a part in the minimap to represent the terrain
Thanks!
do you know how to translate this into a surface gui?
Simply place the viewport frame into a surface gui
how does this guy type so fast?
Why do we move the frame's position instead of the camera?
Because when you move the camera the viewport has to render the texture again so if you have 100000s of parts in your viewport its more optimal to move the frames position
but you don't have to do it this way if you like you could just move the camera
@@5uphi Ah, I thought so. So as long as we don't change anything in the viewport (such as the children/properties/cframes or whatever) the viewport will cache the texture instead of re-rendering every frame
Correct
Hey i've done everything correct and it just doesn't work for some reason.
Double check you must of made a mistake somewhere
@@5uphi i've checked multiple times. it just doesn't work (sorry for late response,forgot about this xD)
Why map only move front left and back right?
I did not quite understand the question
@@5uphi He wants it to rotate on your perspective as well. You could do this by rotating the top down-view camera to be the same rotation as the player's Y orientation. Ofc this will look weird when your character is spinning
Oh well clip descendants and rotating GUI does not work together so if you wanted to rotate the mini map you would have to update the camera every frame
would this work with terrain ?
You would have to use parts to represent the terrain
doesnt work can i have a copy of ur game with this script? :c
There is a copy in the discord server
@@5uphi thanks, u know how i could make it render meshparts and models?
Yes simply parent the meshpart or model into the viewport frame
@@5uphi one more question, why the minimap only renders until the limit of the baseplate?
I think the problem your having is with content streaming when you walk the server will stream to the client but your not adding them new streamed in parts into the viewportframe you will need to use childadded and childremove to detect when parts stream in and out
tnx you
Does it show client sided replications?
Yes but because the viewport only updates when you move from one chunk to the next chunk you would have to force the viewport to update when something changes so this optimised method works best for things that are anchored and are not moving but if you want to have moving parts it might be best to just have the viewport camera update every frame and not worry about the optimized chunk system I show in this video
Don't wanna be that guy, but like... this just does not work anymore
It does work :)
@@5uphi You sure? When's the last time you tested it?
if you share your code in discord we can help you fix it
I was also having issues and I found that making the viewport frame 2 times as big as the frame helped solve it. Also be cautious about getting + and * mixed up. Those are the issues I had
Working for terrains?
no you would have to generate lots of parts to represent the terrain
damn, I thought I'd find one that could render terrain
Only way would be to create parts with raycasting to represent terrain
@@5uphi hmm i never thought of that as a possibility before
thanks for the idea
😍😍😍😘😘😘
Bro you are should make a game in unity or unreal insteas of roblox studio
I like Roblox and Lua is my favourite language but if I did use something else I would most likely try GODOT
Hey man.
I've been trying to write ur script so many times but it just dont wanna work.
local frame = script.Parent
local camera = workspace.CurrentCamera
local viewPortFrame = frame.ViewportFrame
for i, descendat in ipairs(workspace.Map:GetDescendants()) do
if descendat:Isa("BasePart") == false then
continue
end
local clone = descendat:Clone()
clone.parent = viewPortFrame
end
local viewPortCamera = Instance.new("Camera")
viewPortCamera.FieldOfView = 20
viewPortFrame.CurrentCamera = viewPortCamera
local offset = Vector3.new(0, 500, 0)
camera:GetPropertyChangedSignal("Focus"):Connect(function()
local cz = camera.Focus.Position.Z
local cx = camera.Focus.Position.X
local position = Vector3.new(cx, 0, cz)
viewPortCamera.CFrame = CFrame.lookAt(position + offset, position -Vector3.zAxis)
end)
everything is right idk why its not working.
could u please send me the whole script in text ?
In the description of the video is a link to the discord channel
@@5uphi Bruh where in the discord
yoooo
Yo
@@5uphi id really like to learn coding but my inconsistency is against it.. can you give me some tips and proper mindset man? :(((
should i take online courses?
just do it!, I never took any courses
29:29
local frame = script.Parent
local camera = workspace.CurrentCamera
local viewportFrame = frame.ViewportFrame
for i, descendant in ipairs(workspace.MiniMap:GetDescendants()) do
if descendant:IsA("BasePart") == false then continue end
local clone = descendant:Clone()
clone.Parent = viewportFrame
end
local chunkSize = 128
local ChunkHalf = chunkSize / 2
local offset = Vector3.new(0,500,0)
local currentX, currentZ = math.huge, math.huge
local viewportCamera = Instance.new("Camera")
viewportCamera.FieldOfView = 28
viewportFrame.CurrentCamera = viewportCamera
local offset = Vector3.new(0, 500, 0)
camera.GetPropertyChangeSignal("Focus"):Connect(function()
local cx = camera.Focus.Position.X / chunkSize
local cz = camera.Focus.Position.Z / chunkSize
local chunkX = math.floor(cx)
local chunkZ = math.floor(cz)
local x = cx % 1
local z = cz % 1
if currentX ~= chunkX or currentZ ~= chunkZ then
currentX, currentZ = chunkX, chunkZ
local position = Vector3.new (chunkX * chunkSize + ChunkHalf, 0, chunkZ * chunkSize + ChunkHalf)
viewportCamera.CFrame = CFrame.lookAt(position + offset, position, - Vector3.zAxis)
end
viewportFrame.Position = UDim2.new(1 - x, 0, 1 - z, 0)
end)
thank you very much good sir but you missed at line 22. camera:GetProperty... not a dot its a double dot (event)
local frame = script.Parent
local camera = workspace.CurrentCamera
local viewportFrame = frame.ViewportFrame
for i, descendant in inpairs(workspace.Map:GetDescendants()) do
if descendant:IsA("BasePart") == false then continue end
local clone = descedant:Clone()
clone.Parent = viewportFrame
end
local viewportCamera = instance.new("Camera")
viewportCamera.FieldOfView = 28
viewportFrame.CurrentCamera = viewportCamera
local offset = Vector3.new(0, 500, 0)
camera.GetPropertyChangeSignal("Focus"):Connect(function()