Search code examples
c#unityscriptblenderunity-game-engine

GameObject shaped like a piece of cake in Unity 5?


sorry for my bad english. I'm from germany^^

My question:

Is it possible to transform an empty game object into a shape that Looks like a Piece of cake? I have a round terrain and I want to "cut" it in three pieces of cake, because I want to play different music in all three areas. I Need These pieces of cake as a box/mesh collider or something like this, so I can Play different Songs if the Player collides with the box/mesh collider.

Ideas anyone? Please help me. :) Is it possible to build an object in Blender for example and use it as an invisible box collider?


Solution

  • Create the shape in Blender. Create a MESH COLLIDER. Assign your piece of cake model to the MESH parameter of the MESH collider. Scale it. Position it. set it as trigger and VOILA!

    This would be the mesh you create in blender (RED) enter image description here

    then,

    void OnTriggerEnter(Collider other) {
        //play song
    }