Skip to main content
New Participant
March 15, 2024
Solved

Break a Glass using Meta SDK

Hi. Is there anyone have any idea how to create a breaking glass using meta sdk? I'm developing a new project at the moment and I don't have any idea what am I doing. 

    This topic has been closed for replies.
    Honored Contributor
    March 15, 2024

    You'll first need to create a fractured version of your glass in a 3D package like Blender (https://www.youtube.com/watch?v=S1UvEd1xkco) Add the rigidbody and mesh collider for each piece as shown in that video, but you'll probably want to to a runtime swap between the original model (prefab) and the fractured (prefab), perhaps when the glass hits the floor, or whatever is appropriate for your scene. So perhaps start with the unbroken glass and attach a script to it that has an OnCollision method (https://www.youtube.com/watch?v=QRp4V1JTZnM) then when that's detected, instantiate the fractured prefab and disable the original glass.

    2 replies

    Honored Contributor
    March 15, 2024

    You'll first need to create a fractured version of your glass in a 3D package like Blender (https://www.youtube.com/watch?v=S1UvEd1xkco) Add the rigidbody and mesh collider for each piece as shown in that video, but you'll probably want to to a runtime swap between the original model (prefab) and the fractured (prefab), perhaps when the glass hits the floor, or whatever is appropriate for your scene. So perhaps start with the unbroken glass and attach a script to it that has an OnCollision method (https://www.youtube.com/watch?v=QRp4V1JTZnM) then when that's detected, instantiate the fractured prefab and disable the original glass.

    New Participant
    March 18, 2024

    Thank you very much. After a few days, I have finally done it!