Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create a collider ( SplinePathMeshBuilder)
#4
Hm,

I just checked with the MeshBuilder example. I added a MeshCollider to the RoadPath GameObject and additionally this script (MeshColUpdate.cs):










Code:
using UnityEngine;
using System.Collections;

public class MeshColUpdate : MonoBehaviour {
    MeshFilter mFilter;
    MeshCollider mCol;

    // Use this for initialization
    void Start () {
        mFilter = GetComponent<MeshFilter> ();
        mCol = GetComponent<MeshCollider> ();
    }
    
    // Update is called once per frame
    void Update () {
        mCol.sharedMesh = null;
        mCol.sharedMesh = mFilter.mesh;
    }
}

Of course that's horrible slow, but the Collider updates properly when I change Extrusion parameters or modify the underlying spline. Can you test the above script with the example scene, just to be sure this behaves the same on your side?

Jake

 

 

 
Reply


Messages In This Thread

Possibly Related Threads…
Thread Author Replies Views Last Post
Heart Create beautiful curves ShiroeYamamoto 3 11 03-26-2024, 06:25 PM
Last Post: _Aka_
  Is it possible to create a road texture at runtime? artsung 1 4 01-30-2024, 09:30 AM
Last Post: _Aka_
  Collider doesn't get created by the CreateMesh Module pako88 5 10 12-26-2023, 11:13 AM
Last Post: _Aka_
  Combine 2 Create Mesh nodes to one single Mesh danne_lindwall 1 13 02-16-2023, 08:25 PM
Last Post: _Aka_

Forum Jump: