Search Unity

[RELEASED] RayFire for Unity. Runtime demolition and fragmentation plugin.

Discussion in 'Assets and Asset Store' started by Mir-vadim, May 8, 2019.

  1. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    Sorry, but for now there is no support for feature you need. It cuts over infinite plane or fragment object to pieces, you can cut holes using plugin.
     
  2. villaman

    villaman

    Joined:
    Apr 21, 2021
    Posts:
    69
    ok, thank you.
     
  3. vlastan

    vlastan

    Joined:
    Nov 15, 2015
    Posts:
    49
    Hi, i am using rayfire to produce a series of video shots. I use Unity Recorder to record 4k frames with raytraced graphics. As a result, the rendering is quite slow and as a consequence, rayfire demolitions are not triggering during the sequence. I think the physics calculations are somewhow dampened by the lower number of fps during record.
    Is there something that can be done to ensure Rayfire would work framerate independently?
    Or a way to precalculate the demolitions and bake into an animation, so that it won't be needed to perform any calculation during the recording process?
     
    Last edited: Nov 18, 2021
  4. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    215
    I've watched the demo of Rayfire and is wondering if it can partially break the mesh instead of breaking the entire mesh.
    Screenshot (392).png

    Is this possible? Or would I need to divide the wall into chunks beforehand?
     
  5. suppertbw

    suppertbw

    Joined:
    Mar 16, 2016
    Posts:
    34
    I follow the tutorial of Connectivity.Basic to set all scripts. Then I find that all of my models will collapse if the game runs. However, the object "columns_root" in that scene won't collapse, why?
     
  6. wechat_os_Qy0zogmDOnzC_8QfK6-F-QgLo

    wechat_os_Qy0zogmDOnzC_8QfK6-F-QgLo

    Joined:
    Aug 30, 2021
    Posts:
    1
    Please update the document
     
  7. LagSik

    LagSik

    Joined:
    Apr 6, 2020
    Posts:
    5
    Sorry for that maybe dumb question (can manage to find answer online), but is this Unity plugin compatible with all Unity render pipelines? I'm working on the Universal Render Pipeline and I just want to be sure the RayFire will work in my workflow before buying. Thanks.
     
  8. hm2337

    hm2337

    Joined:
    Jun 9, 2019
    Posts:
    9
    Does this have impact deformation? If so, can you do it onClick, where cursor clicks?
     
  9. Davain

    Davain

    Joined:
    Dec 20, 2009
    Posts:
    25
    Hi, there seems to be something wrong with mass calculation for "cluster mass by shards". For example for a box of 2x2x2 scale with "Rayfire Rigid", I get a mass of X. If I shatter that box and place "Rayfire Rigid" set to "Connected Cluster" then at start (box is still intact, all shards are together) I will get much higher total mass. The more shards the higher the mass. But here comes the interesting part, if I will demolish this box so all the shards are separate and then sum up their mass I will get the original X.
     
  10. Steedalion

    Steedalion

    Joined:
    Jul 6, 2020
    Posts:
    51
    No this is not a deformation tool. There is impact based fracture called contact bias.
     
  11. Steedalion

    Steedalion

    Joined:
    Jul 6, 2020
    Posts:
    51
    Make 3 separate walls yes. Also there are zone where demolition can be limited, see YouTube videos.
     
  12. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    268
    hello developer, ive recently decided to purchase your asset for simulation on a project dealing with erosion (mostly as an experiment on the side)

    everything is perfectly fine

    but as I am curious to see how far I can push it, your assets functionality, I wanted to see the effect putting the Rayfire Rigid component on a animated Skinned mesh would have.

    However, I am seeing that on the skinned mesh renderer containing game object, where the script is, it shows:
    "Info
    WARNING: Object excluded from simulation."

    Funny enough, I can still demolish the entire mesh, but I can't cut the mesh.

    Is there something I'm missing or doing wrong? Either way your asset is great thank you for your time.
     
  13. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    Hi, yeah. skinned mesh demolition is not fully implemented since our focus is mostly rigid body simulation and demolition. As for excluded from simulation, it means that Skinned Meshes can be demolished by manually evaluating Demolish() method, it can't be demolished by collision with something. So, it is fine that you see this message, but I probably need to make it less scary for skinned meshes.
    In order to slice such object, you should enable Slice By Blade in its Rigid/Limitation properties and enable Skin checkbox in Blade object properties.
     
    the_unity_saga likes this.
  14. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    268
    I tried but it still didn't work,

    thanks again, i can live without this feature
     
  15. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    268
    Hello again Dev,

    on this post:

    https://forum.unity.com/threads/rel...agmentation-plugin.674593/page-5#post-5782726

    you explain how to set Mass on fragment creation, I want to know how it is possible now?

    im trying to customize Mass on generated fragments rigidbody, is there a way to attach code event or behaviour for all generated pieces maybe by physic tag or material setting?

    how could I best implement this if it is not in your asset already?

    I want to basically have rigidbody settings for mass, friction, etc, per each object types fragments. but customizable way
     
  16. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    what should I do if I want to trigger by code not by physic?
    for example,i have a tree in the scene,and when it be chopped down,i want to trigger to destory it,so there is no physic behavior,how to achieve it? thanks
     
  17. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    Hi, not sure what exactly you want to trigger, but you can dmeolish object to fragments using public Demolish() method, if your Simulation type set to kinematik then after demolition they won't be simulated. Or do you want resulting fragments no to have any of physics related components like RigidBody and Collider?
    You can use Reference Demolition type if so, it allows to replace demolished objects to defined reference which can be root with fragments created in Editor, disable Add Rigid property and you will just replace original object with defined reference without physics.
     
  18. Hex0dus

    Hex0dus

    Joined:
    May 2, 2018
    Posts:
    5
    Dear Vadim, thanks for this wonderful Unity plugin!
    As I see here in the forum, you also give very good support. This is not a common thing, so that stands out positively from the crowd.

    Please allow me two own questions.

    I have meshes with baked AO into vertex color which is used by the shader to display the redish layer in darkend areas. After using shatter the vertex color disappears.

    1) Is there a setting to preserve vertex color?
    2) The clusters were grouped in the hierarchy in earlier versions - seems to not be the case any more? This makes it very difficult to select all the parts

    upload_2022-5-15_19-29-6.png

    upload_2022-5-15_19-29-23.png
     
  19. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    1. Sorry, but there is no support for vertex color tranfer yet, we will work on this in one of the next builds.
    2. As I see you have positive Debris value, this is why you get so much additiona objects, debris allows to get tiny fragments near grouped fragments.
     
  20. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Hi. I have a quick turnaround project and thinking of purchasing this asset to assist.

    I have a building in Unity (an fbx file exported from 3ds Max, with the original file coming from Revit, so its an fbx with many components to it)

    I need to collapse the building into ruble/rocks/junk (in HDRP, preferably with Unity 2022.2.a13)

    Is this an easy enough excerise for the software, or does it need to be a single mesh?
     
  21. Hex0dus

    Hex0dus

    Joined:
    May 2, 2018
    Posts:
    5
    Thank you for the fast answer. Then I will look forward to the next build - this would certainly make my work much easier.

    2. I meant that on the left side of the screenshot the hierarchy isn't grouped. I've seen in your video that there was grouping to be seen but it's not in my case.
     
  22. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    In which video? Shatter component put all fragments as children for empty root, it do not creates deep children.
     
  23. yokenstein

    yokenstein

    Joined:
    Sep 19, 2017
    Posts:
    84
    Does the Rayfire Recorder record particle system Debris? It doesn't seem to record them
     
  24. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    Yeah, Recorder only records transformation of children.
     
  25. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Can I do the following with Rayfire for Unity, and how easy is it? - Fracture a solid object and have it fall into a pile of rubble, then have the pile of rubble, form a new shaped object? So to simplify what I need: Take a "cube" with all same length sides, pile it into rubble, then turn the rubble into a flatter cube or rectangle, almost like I squashed the original cube down and made it wider and longer, but flatter..... (but that is just simplifying my explanation of what I need)
     
  26. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    Hi, you can do only first half, turn cube into a pile of rubble, there is no components to turn this rubble into something else later.
     
  27. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    ok thanks
     
  28. IGORb93

    IGORb93

    Joined:
    Jan 29, 2020
    Posts:
    1
    Hi !
    There is an issue, when i build project on Android.
    I have a kinematic Rayfire Rigid which collides with Sleeping-ConnectedCluster-Runtime bulding.
    The problem is that works fine in the editor but when i start apk, that i builded, it doesn`t work there.
    Would be grateful for help !!!
     
  29. ununion

    ununion

    Joined:
    Dec 2, 2018
    Posts:
    275
    hi vadim,is there any way create shatter in runtime with multiple thread or async way?
     
  30. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    hi, there is only Runtime Caching support for now, it allows to spread runtime fragmentation over several frames. Every frame it generate few fragments until all fragments will be created, then object can be demolished. So you can initiate caching for few seconds before object should be demolished and at this moment all fragments should be created without significant fps drop
     
  31. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    228
    Is there a replacement for RayfireRigid.SetGravity()?

    EDIT: I think maybe rayFireRigid.physics.useGravity = <bool> might do it.
     
  32. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    yeah, it enables/disables gravity for object.
     
    Ghosthowl likes this.
  33. SpectreCular

    SpectreCular

    Joined:
    Jan 15, 2015
    Posts:
    44
    I know this has been asked a couple of times over the past couple years... But now that DOTS/ECS is in 1.0 release, any plans to support it yet? A lot of larger projects are adopting it these days, especially with Havok physics being directly supported for even better performance
     
    lclemens likes this.
  34. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    While I think ECS and DOTS is promising, many platforms it's not supported yet, and I think it still has a ways to go before it's got all the kinks worked out. (At least last I checked anyway)

    I don't know if now is the right time to flesh out support for it when things are still possibly going to change a good bit and it would require him to create a great deal of changes for an entire second code base.
     
  35. kantagara

    kantagara

    Joined:
    Sep 15, 2014
    Posts:
    14
    How would it be possible to sync the current state of a demolished object to new players that are joining the game via multiplayer?
     
  36. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    761
    Come on @Mir-vadim - you know you want to try it!! :D
     
  37. tosvus

    tosvus

    Joined:
    Dec 27, 2016
    Posts:
    44
    Hi, is it possible to use this for an object to simulate how a thick piece of glass would work. I.e. someone uses a hammer or similar and the first time it starts cracking, on the second hit, it disintegrates/fragments? Thanks!
     
  38. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Hello Mir-vadim,

    Is it possible, with this asset, to pre-fragment a wall (for example), and then save the pre-broken wall into a prefab for reuse? In other words, can we make prefabs with this asset?
     
  39. dfernand

    dfernand

    Joined:
    Jun 21, 2014
    Posts:
    9
    I know that Rayfire doesn't support videogame consoles for the target platform via the Unity plugin which in the short term is not a big deal for me as I'm initially focusing on PC as the target platform but looking towards the future does anyone know of an alternative plug-in or tool which would enable me to create a Unity URP which can use 3D destruction with the target platform being PS4, PS5, XBox One etc ? This I would be forced to use if when I get around to a console implemention Rayfire still hasn't been adapted to work with consoles. I asked the 'DestructIt' Unity plug in developers if their tool would enable to do 3D destructive sequences on video game consoles and they were unsure as they've never tested it for that so I am doutful that will work (also I heard that you have to generate your own fragmented sequence to 'DestructIt', which if true would be too much work). I'm stuck between a rock and hard place for 3D destruction for consoles... please give me any useful advice in order to achieve this.
     
  40. tosvus

    tosvus

    Joined:
    Dec 27, 2016
    Posts:
    44
    I don't own it myself yet, but as far as I heard in one video, it sounds like this can work on consoles, but not realtime fragmentation. You just have to prepare ahead of time. I could be wrong though.
     
  41. dfernand

    dfernand

    Joined:
    Jun 21, 2014
    Posts:
    9
    yeah thanks seems like it dunno how I will pre-prepare fragmentation (maybe Rayfire can do something that is 'pre-prepared', like an animation or something dunno).
     
  42. UnkelRambo

    UnkelRambo

    Joined:
    Oct 26, 2012
    Posts:
    80
    Hi @Mir-vadim, loving this plugin so far! I had a question for you about prefabs composed of different types of FireRigid components. Here's my situation:

    I'm using a few different 3rd party asset packs for dungeons and props and such, and I'd like to be able to specify SOME of the prefab pieces as destructible using a Shatter component, and others not shatter but still be part of the larger object's destruction. I'm writing a script to auto-generate prefabs for the Shatter components because I need this to work on consoles and I have about 500 different objects to setup, several of which are nested prefabs of one another. I need the setup to be relatively automatic with minimal configuration.

    For example, the book shelf here:

    Capture.gif

    Is several nested prefabs, including the wooden empty bookshelf part, the books, candles, etc.

    This setup works like a charm! BUT, what I have to do to get this to work is a bit wild and *kind of* fragile. The setup looks like this:

    The object hierarchy:
    - Top Level Object (Nested Cluster)
    -- Bookshelf Wood (Shatter)
    --- Books and Bottles (FireRigid with NO demolition set)

    Each of the objects listed is a separate, nested prefab. The intention here is to set up RayfireRigid and Shatter components at the level of the nested prefabs, but to have a simplified workflow to auto-generate all the mesh assets and prefabs, set up the Reference demo data automatically, etc.

    Then, at runtime, when a custom gameplay event causes the object's destruction (in my case, one of the many abilities that do damage) I loop through ALL FireRigid's on an object and call Demolish() on each of them.

    If I try to Demolish only the top level object (the Nested Cluster) the Bookshelf Wood part (with the Shatter component) doesn't demolish at all (most of the time, sometimes I've had it work with collision, but I don't want collision destroying objects for my use case.) That's expected, as far as I'm concerned. However, I am curious if there's a more intended way to "demolish an entire object hierarchy" like this. So here we go...

    My questions:

    1) Is there an intended workflow for using nested prefabs of destructible objects like this or is this a reasonable setup?
    1.1) Specifically, is there an intended way to trigger the demolition of an object only at the root and have that propagate down to children or is looping through all RayfireRigid components, checking demolition type, and triggering demolition The Way?

    2) Is the Nested Cluster with Runtime Demolition supported on console? ie, is it only the real-time shatter that isn't supported?
    2.1) Or is there an intended way to achieve the "some objects shatter, some objects become rigid bodies" behavior in the bookshelf gif above?

    I'm trying to ensure I can design-time generate all of these shatters to incur as little runtime cost as possible (I'm already near CPU budget.) And this has to run on console :)

    3) Would you be OK if I posted this finished automation script here on the forums or would you rather I not? I see a few questions about prefabs and the workflow and such, I'm hoping it would be relatively helpful for somebody. It's very lightly tested, only took me a few hours to whip it up, but you never know...

    Hope that all makes sense! Loving this asset so far!!! As a former AAA dev this is easily one of the most professional quality assets I've used so far :)
     
    Last edited: Dec 6, 2022
    DonCornholio and zalogic like this.
  43. zalogic

    zalogic

    Joined:
    Oct 6, 2010
    Posts:
    273
    Hey there! Are there still any plans to support Unity Jobs for runtime destruction processing?
     
    homemacai likes this.
  44. Denis1122

    Denis1122

    Joined:
    Jan 6, 2020
    Posts:
    9
    Hi @Mir-vadim!
    Сan destruction be rewound? Destroy and then put the pieces back together into an object? (no solid object)
     
  45. Savanorolla

    Savanorolla

    Joined:
    Dec 15, 2021
    Posts:
    3
    Hi!
    I am a sound designer and therefore not strong in code. I need to somehow take the fragment IDs to trigger the Wise sound event when they collide with each other and separate surfaces. Please tell me how I can implement this in my code?
     
  46. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    For rewind a destruction you would need something that controls the time for making the awesome and amazing destruction by Rayfire with some additional script and there may be something in the asset store for you

    I wanted also to know some time ago to rewind something that was destroyed and it seems that for this you would need a time controller that controls it, or better said a time rewind script. For example here is an asset script that does this https://assetstore.unity.com/packages/tools/physics/time-rewinder-108724 As you can see in the video shown you can explode something and then after go back to the original before the explosion as it was.

    I have not used this time rewinder, what I have used is Chronos Time control that will let you rewind anything that you want but it seems that is deprecated and not available anymore (see rewind time at 0:53 and more important PHYSICS REWIND at 1:53 that is what you want )


    So for rewind you have to search for what is available now for "time control" or "time rewind" or "time management" in the asset store

    There is another new way now that I have bought but I think that it maybe it will not work for destruction, although I have not tested it. It is https://assetstore.unity.com/packages/tools/utilities/flexalon-3d-layouts-230509 that as shown in the video you can rewind the original position of things.
     
    Last edited: Mar 30, 2023
    Savanorolla likes this.
  47. DonCornholio

    DonCornholio

    Joined:
    Feb 27, 2017
    Posts:
    92
    Did you ever get a reply from the developer on your question? I am evaluating wether i should buy this asset or switch to unreal and use chaos physics. Since you posted your question about 4 months ago and there was still no post i could see, i am weary that i will waste 200 Euros on a badly supported asset...
     
  48. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    No, there is no such support for ingame demolitions. You can record your simulation in Editor using RayFire Recorder script into keyframe animation and then play it and rewind in game build tho.
     
  49. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    Sorry, I created this topic when just launched plugin, since then I started Discord channel where I provide full support most of the time. It is much easier and faster to get and provide support there instead of writing messages here.
    I will put link in first message so other users will go there for faster help.

    https://discord.gg/zSAEKyZvyE
     
  50. Mir-vadim

    Mir-vadim

    Joined:
    Apr 18, 2017
    Posts:
    256
    First of all, there is RayFire Sound component for some basic sound support for Demolition, Activation, Initialization and Collision.
    If you want to use it for fragments generated in runtime then you should use Demolition Event system, it notifies you when specific (local) or any (global) object with Rigid component was demolished. Then you can access to all fragments it generated in its .fragments list and do with them whatever you need. There is tutorial script in Tutorial folder so you can check how it works or use it with some simple modifications.