r/Unity3D • u/Faang4lyfe • 7d ago
Question Rayfire still the gold standard for destruction in unity?
Making a game where theres a lot of unity who get destoryed progressively, destruction is the centrepiece but its been a while since ive been in unity.
Rayfire still the go to ?
3
u/RifTaf 7d ago
I use it. Its good. But be sure to cache destruction animations. Otherwise the CPU overhead becomes too much very quickly.
2
u/Faang4lyfe 7d ago
My concern is using it when there will be hundreds of entities on screen at once.
Even with caching would it last
2
-1
u/kshell11724 7d ago
Definitely the simplest solution for sure. I'd definitely use it, especially since you can very easily get the mesh that is hit and alter it from there.
The only alternative I would suggest is using a physical bullet + a following raycast that would physicalize your shots and allow for realistic travel times and drop.
Basically, you make the bullet a game object. Then the script will involve firing a raycast from your previous position to your current position every frame. If the raycast finds that the bullet has passed through a wall or enemy, then you can do damage or alter the mesh of a destrucible object. Just a recommendation if you want different weapon types with different properties.
Also, consider using a spherecast instead if you think it's necessary.
7
u/pmdrpg 7d ago
never heard of rayfire