Hi I’m trying to get a particul effect trigger by a animation event.
I made a script with a function to play the particule effect.
I would like to call that function at a point of my animation.
So I added a event at the right moment, but then can’t use the event to do anything
How Am I suppose to fill this ? Object no gameObject.
Really frustating as in the tutorial you have a dropdown list with function you can call and I have this things…
When you hover your cursor over a marker, a tooltip displaying the function name and argument value appears. By hovering the mouse over an Animation Event marker, you can see the function it calls as well as the argument value.
Also you mentioned your script contains the field Object gameObject. It should be GameObject gameObject, which is why I believe it is not working. The field you put is looking for an Object, while the particle effect you are trying to instantiate is a GameObject.
Hello, thanks for your respond. Today After restarting unity it’s fixed.
Unity event look like that :
this is my script for info :
public class StartAnimationScript : MonoBehaviour
{
[SerializeField] private ParticleSystem ps;
// Start is called before the first frame update
public void StartParticuleSystem()
{
try
{
ps.Play();
}
catch
{
}
}
}
Now I have to work on the effect to match the movment of the animation.
Any tips about that? When I play this animation in this animator, the event and particule are not display. I have to play it in the scene to see the particule effect.
I would store the position of where you want the particle to leave from, and then instantiate the particle at that position in a method. Then you can call the method on the AnimationEvent. Then after a certain time, destroy the particle.