- Home /
Terrain tree painter doesn't work with mesh collider
Summery of what I did
Exported my own tree from maya
Put it into unity and assigned it a mesh collider Works
Made it a prefab with mesh collider Works
Made sure tree collider is enabled, used tree with paint No Collider
Made a capsule collider and updated prefab Works
Paint with it Works
Question
Is the mesh colliders inability to work with terrain trees intentional or a bug? I want the collider to be quite accurate so people can climb and slide down trees so is there any way to get the mesh colider to work at all with the terrain?
Answer by ahgr123 · Aug 24, 2014 at 04:28 PM
you can place objects with terrainrand script. attach it to terrain and it will place object to your terrain randomly. For prefab select prefab you want to spread , for count select total number of all objects and then you can set range of random rotation.
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class TerrainRand : MonoBehaviour
{
public GameObject prefab;
public int count = 1000;
public float randomRotationX = 0;
public float randomRotationY = 0;
public float randomRotationZ = 0;
}
problem is too many trees with these meshes and your in a lot of trouble with performance
Actually they find out trees as objects are faster than trees placed within terrain systems... http://forum.unity3d.com/threads/using-tree-gameobjects-vs-unitys-built-in-system.183224/
number1 : way back in 2006, since then unity moved on so much number2: by meshes i ment mesh colliders, because he wants them on every tree, that basically doubles everything
$$anonymous$$y trees don't work off independent leafs and are in a cartoon style so the mesh isn't that complicated and the poly count is quite low
Answer by AngryBurritoCoder · Aug 24, 2014 at 10:19 AM
You will need to place trees instead of using unity tree system
Isn't there any scripts that can mass place trees with working colliders? or any mods to get the terrain to work with it?
Your answer
Follow this Question
Related Questions
Terrain Tag OnControllerColliderHit not showing 0 Answers
first person controller help 1 Answer
Animated Object falls through elevated terrain 0 Answers
How to create a ground/terrain/floor that won't respond to gravity or objects falling on it? 1 Answer
Shadows popping in/out during runtime 0 Answers