Support Us and Enjoy an Ad-Free Experience!

We understand that ads can sometimes be a bit intrusive.

If you'd like to help us improve your experience and enjoy an ad-free browsing journey, consider the following option:

Upgrade to Ad-Free Experience

[Prefab]Rero's Animate On Collision VRCModsVER 1 W/TUTORIAL Screenshot
Download

1.8K Total Downloads

44.1K Total Views

Asset Type Animations

File Type Unity Package

Description


This stop-action animator system will allow you to play any animation when a particle collides/dies.
Yes, this works on PlayerLocal. Be responsible.
Video Demonstration/How To Use: https://youtu.be/fdUZ-cpGNZ8

Copy of ReadMe:
How to Use

Move the "PulseAnimator" object so that the flashing particle collides with the "On" cube.
This will trigger the animation, enabling the cube with a sound.
To reset the system for the next use and disable the cube, Toggle the "Reset" animator on the "Reset" GameObject.
This animator should turn itself off after the reset is complete.
For use, both the flashing particle system and the collider that kills it must be jointed to the avatar where you need them. (or IKed: https://youtu.be/0MgtpcQ5-Ew)
The actual system from "Reset" down can technically be anywhere.

So, how's this working anyway?

I'm abusing 2 things:
Stop-action on particle systems.
Mechanim animator resets.

Basically, 2017 particles now have a feature that allows you to perform an action when the last particle in the system dies. In this case, it disables the object the particle is on.
If we use an animator to keep the object with the particle on it enabled then it will disable from stop-action and immediately enable again.
Now, animators.
I went over this in my state-machine cycler video: https://youtu.be/GHjWF4yflRU?t=50
Essentially, turning the object an animator is a part of to disabled and enabled again while the animator is still on will set its state to "Entry" which resets the animator from the beginning.
In this case, I'm using a stop-action triggered or "non-linear" animator to cause the animation to only play if the object is disabled and enabled again.

Here is exactly what happens in this system:
The "OnLogic" object immediately enters its suspend state, disabling its animator.
The reset, which is on by default, forces the animator on the "OnLogic" object to move passed suspend into its third state then turns itself off.
This disables the cube.
The "OnLogic" particle being emitted by the "EnableSample" emitter and dying immediately causes the "OnLogic" object to rapidly be disabled and enabled again.
This resets its animator to entry.
The "OnLogic" animator enters its first state.
This enables the cube.
The "OnLogic" animator enters its 2nd state.
This disables its animator, locking the state.
Since the reset animator is off, the "OnLogic" animator will not move passed it's suspend, effectively toggling the object.
The reset animator animates the "OnLogic" animator which forces it passed the suspend into the 3rd state.
This disables the cube, resetting the system.

Frankly, it's a lot to take in.
I don't expect most of you to understand it to be honest and that's ok.
This is here for the people that think they can and have the drive to learn something new.
Once you figure out how it's all happening there are a ton of possibilities now available to you.

I've spent a very long time developing this method, this is just the base logic to get you started.
There's some pretty complex working systems I've already made with this as a base.

Feel free to contact me with questions or suggestions on Discord: Rero#9097

Assets (16 files inside Unity Package)


/Assets/VRC LABS/ANIM/Universal Animations/Suspend.anim
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/Stop-Action Animator Example.unity
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/LogicOff.anim
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/FixFlicker.anim
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/KeepActive.anim
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/Reset.controller
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/Reset.anim
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/CubeSound.ogg
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/LogicOn.anim
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/Logic.controller
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/-System.prefab
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/KeepActive.controller
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/PulseSampler.controller
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/PulseSamplers.anim
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/FlickerFix.controller
/Assets/VRC LABS/State Machine Lab/ReroAnimateOnCollision VRCM Ver_1/ReadMe.txt
Comments

You must be logged in to comment. Login Now
Red134 1555648777 ago

I thought that only applied to world particles, not local. No particles are emitted, just a game object on and a sound. Will try again with that and see.

0
RetroGEO Author 1555227873 ago

Did you make sure to use joints/ik for the positions?

0
Red134 1555210493 ago

it works in unity but not in game

0
rithrin 1554145660 ago

Dno If its just me But noticed that if you toggle this with a hand gesture. On or off dose no matter. The longer the hand gesture is held down, it'll destroy frame rates. Have poked you on discord to try find more out about this.

0
rollthered 1550602493 ago

Going to use this to make a meme soundboard lmao

0
RetroGEO Author 1550073729 ago

It should go without saying but nothing is ever going to fix the "late joiner desync" that occurs when someone new joins the room after you've toggled something. All that can be done is that you can either get everyone to the same state by repeatedly enabling or reset for everybody. That should "sync" people.

0
RetroGEO Author 1550073569 ago

@HoloWorld00 Considering I made a whole video about the benefits of using IK in the place of joints I'm gonna go ahead and recommend that method. :P

0
lindesu 1550057892 ago

@Red134 You've definitely missed the purpose. I used the mechanism in this prefab to make 2 different types of projectiles that have sound on collision, an inventory, and a bow. You're just doing it wrong

0
HoloWorld00 1550047953 ago

@RetroGEO Do you recommend IK or Joints for this system? As I have been working a bit on with joints and it seems to desync for others. Before I delve into IK, which one is most recommended here?

0
Red134 1550036552 ago

I don't see how I can miss a purpose that does not exist

0
RetroGEO Author 1549998590 ago

@Red134 You appear to be missing the purpose of this system in the first place. If all you can think of seeing this is "me make bullet" it's not for you, sorry.

0
Red134 1549988246 ago

absolutely useless it flickers so fast theres no possible way you could make a bullet or anything meaningful from it

0
DoppeIganger 1549920507 ago

God tier prefabs

0

Become a Part of the Leading VR Modeling & VRChat Network

Ready to immerse yourself in the exciting world of VRChat and 3D assets? At VRCMods, we're not just a community, we're a vibrant network of creators, innovators, and enthusiasts. Connect with fellow VRChat enthusiasts, access top-tier avatar commission services, comprehensive tutorials, and enjoy a wealth of free downloads - all with regular updates to keep you on the cutting edge.

Explore the Forum Join Us Now

Explore Accurate and Up-to-Date Tutorials for VRChat Avatars and 3D Modeling

Delve into our dedicated user-generated section, brimming with comprehensive and precise tutorials for everything VRChat Avatars and 3D modeling. Learn about the latest in 3D asset creation from a reliable and always up-to-date source, fostered by a community of skilled creators and enthusiasts.

Uncover Our Quality VRChat and 3D Modeling Tutorials