Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to change mesh filter shape? (Load from Library/unity default resources?)

Discussion in 'Scripting' started by zRonno, Jun 24, 2020.

  1. zRonno

    zRonno

    Joined:
    Jun 9, 2020
    Posts:
    8
    I'm decently new here, so I hope this question makes sense. I would like to create a "shifting" mechanic where a player shifts from a "capsule mode" to a "sphere mode". I was able to change the collider, but not the shape. I thought of changing the shape of the mesh filter, however I found no way to access the assets within the Library/unity default resources folder in script. Is there any way to do this?

    Thanks for any replies, hopefully this is explained clear enough.
     
  2. Terraya

    Terraya

    Joined:
    Mar 8, 2018
    Posts:
    646
    Hmm , how about a Mesh with blendshapes?
    Would that solve your problem :eek:?
     
  3. zRonno

    zRonno

    Joined:
    Jun 9, 2020
    Posts:
    8
    Sorry, not so sure what blendshapes are....
    Right now I'm just using the standard shape meshes.
     
    Terraya likes this.
  4. Terraya

    Terraya

    Joined:
    Mar 8, 2018
    Posts:
    646
    alright thats no problem,

    blendshapes are, lets say:
    - You Create a Cube in a 3D Modeling Programm like C4D/Maya/Blender and so on ..
    - Then you deform it from a Cube to a Triangle or do whatever deformation you want and obv. add it as blendshape

    then in Unity you can basicaly change the blendshapes in Unity and deform it easy

    That concept is used OFTEN by equipping Systems - https://www.twitch.tv/videos/629622624?t=0h0m35s

    in that stream im doing some
     
  5. zRonno

    zRonno

    Joined:
    Jun 9, 2020
    Posts:
    8
    Thanks, that would definitely come in handy once I start to dive in with modelling.

    I wonder if there is a solution that could act a bit like this:


    It seems like it should be very simple, but for some reason I can't find any way to access the "Library/unity default resources"...
     
  6. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,735
    Just create a public array of meshes in your script and assign the ones you want to cycle through from the inspector.
     
  7. zRonno

    zRonno

    Joined:
    Jun 9, 2020
    Posts:
    8
    Well the problem here is that I can't access the meshes.