|
| 14 Jul 2016 03:05 PM |
to make a minimap compass that works with terrain
Add 13,000 posts |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2016 03:08 PM |
elaborate
Star Wars Fans: https://www.roblox.com/games/345312845/- |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
| |
|
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 |
|
|
|
| 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
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 14 Jul 2016 03:43 PM |
| By terrain do you mean SmoothTerrain? |
|
|
| Report Abuse |
|
|
|
| 14 Jul 2016 03:44 PM |
yeah i have a massive map of smooth terrain
Add 13,000 posts |
|
|
| Report Abuse |
|
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|