Jump to content

Recommended Posts

Posted

You know how in the editor, you can create a shape, add a material, then select a face and add a different material to it? How would I do that using code?

 

I know I can create multiple surfaces in a model, but then you dont have the entire mesh to set as the collision shape and things get messy.

 

Basically, I want to know how to create a mesh with multiple materials and set the whole mesh as the collider for the model.

Posted

I know that much. The problem with doing things that way is (as far as I know) you can only set a single surface as the shape/collider for that model. Other engines use sub-meshes where you have one main mesh, then add triangles with an ID that have different materials.

 

I just want to know what goes on when you do this in the editor, so I can do it in-game.

Posted

So are you saying you want to set materials on shapes? You don't generally do that as shapes are generally just used for collision which is invisible. Curious as to why are you wanting to do this?

Posted

No, not on the shape, on the mesh/surface. You can create multiple surfaces for one model, but you can only set one of those surfaces as the shape for the model. I'd like to be able to create just one surface that has multiple materials. Or alternatively, somehow add a combination of all the surfaces in a model as the shape.

 

I can see where the confusion is... When I said shape, I meant a shape, like level geometry, eg cube, cylinder, etc.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...