Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Examples for Mesh updating and Particles
#2
(23-01-2023, 09:12 PM)NewCoder Wrote: how I can get mesh and update its particles which will give me the result as mesh collider

Hi!

"Getting the mesh and updating its particles" are two entirely unrelated things, and neither will give you a MeshCollider as result.

The mesh deformed by a softbody at runtime is just a skinned mesh, so you can get it by using skinnedMeshRenderer.BakeMesh() like you normally would in Unity. You could then use this mesh as input for a MeshCollider component, if that's what you are looking for.

Not sure what you mean by "updating its particles". Particles are not part of the mesh, they're part of either a blueprint or a solver. The ones in the solver are updated every frame by the ObiSolver component to follow a physical simulation. Unless you want to add/remove particles or somehow drive their movement, size, mass or some other attribute in a custom way (which you do by using the particles API) there's no need to manually update them.

(23-01-2023, 09:12 PM)NewCoder Wrote: My main purpose in this post is to understand how I canĀ use the Mesh in the blueprint by code. Sonrisa

Getting the blueprint's mesh from code is pretty simple:
Code:
var mesh = blueprint.inputMesh;

let me know if you need further help,

kind regards
Reply


Messages In This Thread
RE: Examples for Mesh updating and Particles - by josemendez - 24-01-2023, 08:35 AM