generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: is this possible?

Previous Thread :: Next Thread 
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 03:05 PM
to make a minimap compass that works with terrain


Add 13,000 posts
Report Abuse
MasterXertz is not online. MasterXertz
Joined: 04 Jun 2010
Total Posts: 1499
14 Jul 2016 03:08 PM
elaborate


Star Wars Fans: https://www.roblox.com/games/345312845/-
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 03:09 PM
i want to have a gui that shows my character's position on the terrain

i'm wondering if this is possible since most other ones don't have functionality for terrain


Add 13,000 posts
Report Abuse
0Dan is not online. 0Dan
Joined: 22 Oct 2009
Total Posts: 2552
14 Jul 2016 03:15 PM
I'd suggest you do something like use Region3 and magnitude to get the terrain around the player, but FindPartsInRegion3 has a limit..


𝐃𝐚𝐧𝐢𝐞𝐥
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 03:17 PM
ok if i can get the terrain around the player what do i do from there


Add 13,000 posts
Report Abuse
Milenveliki is not online. Milenveliki
Joined: 14 Aug 2013
Total Posts: 1097
14 Jul 2016 03:17 PM
It is :D!
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
14 Jul 2016 03:32 PM
A simple way would be to use raycasting.

http://wiki.roblox.com/index.php?title=API:Class/Workspace/FindPartOnRayWithIgnoreList
http://wiki.roblox.com/index.php?title=API:Class/Workspace/FindPartOnRay

If the ray hits terrain the fourth return value will be the terrain material.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 03:35 PM
"A simple way would be to use raycasting."

i know i was being an ass to you earlier with the whole coroutine thing but can you guide me a bit more with this

if the ray hits terrain is it a cube?

how should i go about casting rays


Add 13,000 posts
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
14 Jul 2016 03:43 PM
By terrain do you mean SmoothTerrain?
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 03:44 PM
yeah i have a massive map of smooth terrain


Add 13,000 posts
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 04:04 PM
.


Add 13,000 posts
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
14 Jul 2016 04:17 PM
You can raycast down from the sky from a point above the highest terrain piece.

But, in order to avoid the ray hitting parts you would have to use an ignore list of all the models/parts to ignore.


e.g. for a 100x100 stud range(25x25 4 stud cubes) :

local IgnoreList = {PlayersCharacter}
local Height = 1000 -- point on y axis to cast ray from

for x = PlayerPosX - 50, PlayerPosX + 50, 4 do
for y = PlayerPosZ - 50, PlayerPosZ + 50, 4 do
local _, _, _, material = workspace:FindPartOnRayWithIgnoreList(
Ray.new(Vector3(x, Height, z), Vector3.new(0, -1000, 0)),
IgnoreList
)
if material == Enum.Material.Grass then
-- make minimap cell at point to green
elseif material == Enum.Material.Water then
-- make minimap cell at point to blue
-- etc
end
end
end
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
14 Jul 2016 04:21 PM
ok i see what you did

so every few seconds if i run that loop it will find all terrain within 100 studs of my character?

that's super useful

now, i'm not sure how to put that onto a gui

if you can help me further i will give you 10000% credit if this game gets anywhere


Add 13,000 posts
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
14 Jul 2016 04:44 PM
I'm gonna be gone for a while, follow me and pm me and I will get back to you.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image