Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
|
| 05 Aug 2015 08:13 AM |
| Nobody knows anything about terrain... |
|
|
| Report Abuse |
|
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
|
| 05 Aug 2015 10:12 AM |
| http://wiki.roblox.com/index.php?title=API:Class/Terrain/GetCell |
|
|
| Report Abuse |
|
|
| |
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
|
| 05 Aug 2015 10:17 AM |
I am using material not CellMaterial and I couldn't find it on wiki. |
|
|
| Report Abuse |
|
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
|
| 05 Aug 2015 04:54 PM |
Sorry I took so long to get back to you.
You should consider using this function:
http://wiki.roblox.com/index.php?title=API:Class/Terrain/ReadVoxels
(Also I apologize for misreading the question at first) |
|
|
| Report Abuse |
|
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
|
| 05 Aug 2015 04:57 PM |
--[[Thanks, I tried using it and here is my function and error (I was hoping there'd be an easier way, but roblox made it this difficult DX): ]]--
local ws = game:GetService("Workspace") local fishLocation = ws.Fish local terrain = ws.Terrain
function animateFish(fish) while fish do local rot = math.random() for _ = 1, 31 do fish.CFrame = fish.CFrame * CFrame.fromEulerAnglesXYZ(0, 0, rot*0.1) wait() end for _ = 1, math.random(30) do local cf = fish.CFrame*CFrame.new(Vector3.new(0, 0.10, 0)) local v = Vector3.new(cf.X, fish.Position.Y, cf.Z) local material, occupancy = terrain:ReadVoxels( Region3.new(v, v):ExpandToGrid(4), 4 ) if material == Enum.Material.Water then fish.CFrame = CFrame.new(v) end wait() end --wait(math.random(50)) end end
--[[ it doesn't work and i don't know why, can you help pls? ]]-- |
|
|
| Report Abuse |
|
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
|
| 05 Aug 2015 05:01 PM |
for _, fish in pairs(fishLocation:GetChildren()) do spawn(function() animateFish(fish) end) end
oh sorry this is the rest of it |
|
|
| Report Abuse |
|
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
DogeKip
|
  |
| Joined: 06 Mar 2011 |
| Total Posts: 6860 |
|
|
| 05 Aug 2015 11:41 PM |
local cell = game.Terrain:WorldToCell(position) local mat,block,orientation = game.Terrain:GetCell(cell) if mat == Whatever material code
On and on south of heaven | Previously: awesom914 |
|
|
| Report Abuse |
|
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
|
| 06 Aug 2015 06:20 AM |
| I'm using Enum.Material not Enum.CellMaterial so I can't use :GetCell() |
|
|
| Report Abuse |
|
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
| |
|
|
| 06 Aug 2015 08:43 AM |
I suggest using ReadVoxels and trying to use what it returns to find the specific x/y/z
I really don't have any other suggestions for you, sorry. |
|
|
| Report Abuse |
|
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
|
| 06 Aug 2015 09:10 AM |
| war i gave you my script and it doesnt work can you help me fix it |
|
|
| Report Abuse |
|
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
|
| 06 Aug 2015 09:21 AM |
nevermind, i found out the problem.
the problem is that roblox made it so that its
material[1][1][1] for some reason...
made the material buried in tables |
|
|
| Report Abuse |
|
|
|
| 06 Aug 2015 09:23 AM |
| As is explained on the Wiki had you bothered to read it instead of spamming this forum. |
|
|
| Report Abuse |
|
|
Climox
|
  |
| Joined: 22 Jun 2012 |
| Total Posts: 716 |
|
|
| 06 Aug 2015 02:09 PM |
| stop posting on my forums you jerk |
|
|
| Report Abuse |
|
|