I have several animations that I want to play a little before an event fires, so I trigger that event with spikes in the curve of the animation. It works pretty well normally, but I’ve been working via Remote Desktop a few times recently and they never seem to trigger in that case … with pretty awful frame rate. In fact, there have been times when my home computer had brief performance issues while I was testing and sometimes (intermittently) they wouldn’t fire then too.
I was wondering if there’s a more reliable way to produce those kinds of triggers in Unity without having to fall back to a plugin. Seems like it should come standard (or Professional, in my case.)
Thanks!
Use invoke and a trigger function?
Invoke(“trigger”, 2); //or whatever interval you want
function trigger (){
// do searching here
}
But how do you attach that to a precise point in an animation without programming? That’s the point of the trigger, actually. So the design / animation folks don’t have to play guess work at when the trigger should fire. If all I wanted was a delayed function fire, I could have used a time-sensitive yield or Invoke, yes. Thanks for the idea, though.
Edit: Hmmm … I wonder if there’s a way to iterate through the keyframes of an animation? That would probably allow me to programmatically fire off what I need to do and they can still set the curves where they want.
Edit 2: And there is! Thanks! That will help fix a lot of the bugs we were experiencing 