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
  Create Game Object Renaming Options rickgplus 1 387 09-23-2025, 09:33 AM
Last Post: _Aka_
  Create Mesh Node, Make Static Options rickgplus 1 1,371 01-23-2025, 10:12 AM
Last Post: _Aka_
  Box Collider Alignment Petusarian 5 2,211 10-21-2024, 10:28 AM
Last Post: _Aka_
Heart Create beautiful curves ShiroeYamamoto 3 1,965 03-26-2024, 06:25 PM
Last Post: _Aka_

Forum Jump: