Jump to content

Nav mesh skips items with viewrange=4


shadmar
 Share

Recommended Posts

Run this from a pivot in an empty map:

If you change ViewRange to 0,1,2 or 3 it works. But 4, skips the nav entirely.

 

function Script:Start()
       ground=Model:Box()
       shape=Shape:Box(0,0,0, 0,0,0, 1,1,1)
       ground:SetShape(shape)
       ground:SetScale(40,1,40)
  	 ground:SetNavigationMode(true)

       player=Prefab:Load("Prefabs/Player/FPSPlayer.pfb")

       for n=0,10
       do
           local b=Model:Box()
           b:SetShape(shape)
           b:SetPosition(n,1,n)
           b:SetScale(n,1,1)
           b:SetViewRange(4)  -- this kill navigation
           b:SetOcclusionCullingMode(false)
           b:Turn(0,Math:Random(-15,15),0)
           b:SetNavigationMode(true)
       end

       shape:Release()

       self.world=World:GetCurrent()
       self.world:BuildNavMesh()

       camera=player.script.camera
       camera:SetDebugNavigationMode(true)
end

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...