Questions tagged [unity3d-terrain]

56 questions
0
votes
1 answer

Unity3D terrain SetAlphamaps method gives error: Assertion failed on expression 'spResult == PixelAccessReturnCode::kOk'

i am trying to make a script that creates a backup of my terrain so it can be restored after editing it at runtime. SetHeightMap() restores my terrain as expected but SetAlphamaps gives me this error: Here is my script. It is attached to the…
0
votes
1 answer

Know how to fix this Unity Terrain Trees/Details clipping issue?

I know Unity Terrain isn’t the most robust thing but has anyone ever seen this issue where a plane (in this case, the water) clips trees/details at certain angles? I had the same issue with a particle effect that I was able to fix by creating a…
Tim Samoff
  • 94
  • 11
0
votes
0 answers

How to spawn player object in 3D terrain map with elevation that is accurately sized and scaled?

I am spawning a player object on a Mapbox 3D terrain map. I need to spawn this object with an accurate size and scale in accordance with the map. (ie, I don't want to spawn a giant player or tiny player that is not accurate to world scale). How can…
0
votes
0 answers

SetHeights doesn't work when I change terrain position

I need to edit terrain in real-time when I click on terrain at that position to raise that part. the code work just fine but the problem is when I change the terrain position it doesn't, work anymore. I get this error : ArgumentException: Trying to…
Dev
  • 1
  • 4
0
votes
0 answers

Unity Picture From Camera Clear in Center, Distorted at Edges

I am fairly new to Unity but am trying to take a photo from the camera and save it. Taking a screen capture is not an option. When I take the photo it appears clear in the center of the photo but gets further distorted towards the edges and I am not…
0
votes
2 answers

Unity navmesh bake issue on terrain

I'm having this issue while baking navmesh on terrain. So many gaps on the whole terrain navmesh. An solutions??? Note: I've converted that terrain into mesh as well but same results.
0
votes
1 answer

How to Move Terrain to Another Unity Project File?

How can I import terrains onto another Unity project? I am new to developing on Unity. I would like to place this terrain... Onto this project. And as you can see... Nothing shows! So, how do I make the entire terrain appear on this Unity project…
0
votes
0 answers

Unity C# Generating custom mesh for voxel terrain not loading properly

So, I am in the process of creating a infinite terrain system similar to Minecraft's. I am making it myself out of personal interest to learn. I have most everything working, and I have made some functions to generate the faces of cubes and then I'm…
King Duck
  • 106
  • 2
  • 9
0
votes
2 answers

Unity Custom NavMesh obstacle for terrain trees?

I have a terrain with trees on it that is baked into the NavMesh. The NavMesh automatically creates a barrier around the trees, but it seems to be based around the model, not the collider. Since I only want the AI to dodge the trunk of the tree, not…
0
votes
1 answer

Is it possible to use a heightmap like Mathf.PerlinNoise();?

I am relatively new to Terrain Generation in Unity, and am currently stuck in one place. I have followed Brackey's tutorial on terrain generation, and in that tutorial, he uses something like this: float y = Mathf.PerlinNoise(x, z) * 2f; To…
0
votes
0 answers

Unity Terrain Texture Stretching

I am new to Unity's terrain system and was trying to create a terrain for a game. I finished my terrain and then wanted to begin texturing it, to my dismay the textures that I'd try would become extremely stretched due to the height I have some…
warlord
  • 3
  • 2
0
votes
2 answers

Unity terrain texture missing after upgrade from 5 to 2020

I upgraded from Unity 5.4 to Unity 2020 and after my project was imported the terrain for one of the scenes seems to be missing the texture (see image below). Anyone have any suggestions for a fix? I've also include my Terrain Settings screenshots…
0
votes
2 answers

How can I calculate an average terrain slope based on four points?

I'm programming a simple physics system for vehicles in Unity and I'm trying to figure out how to calculate the average slope based on four points in order to apply the gravitational acceleration. I can get the terrain height at the vehicle wheels…
Wojtek Wencel
  • 2,257
  • 6
  • 31
  • 65
0
votes
1 answer

Mapbox Terrain v2: how do I modify contour elevation range?

I'm using Mapbox Terrain vector tileset to show elevation contours on my map. But my region of interest is quite flat, so there aren't any visible contours in that area. (basically, I see contours all around my region, but not in the actual region I…
0
votes
0 answers

Why does the array I pass to my multithreading job struct act as a reference type?

I'm working on a unity project involving deformable terrain based on marching-cubes. It works by generating a map of density over the 3-dimensional coordinates of a terrain chunk and using that data to create a mesh representing the surface of the…