On particle collider hit, play animation

Hi

I’m trying to grow a flower in game when the player in VR has watered it. I have an animation of the flower growing in maya and blossoming, and I want this animation to be stretched to 2 minutes, so it will take 2 minutes for a flower to blossom. How would I go about scripting something like this with bluprints?

(First time working in UE4 and blueprints, and very new to coding in general)

How did you make the flower growing animation? Is it done by moving skeletal meah bones or vertex displacement or what? the animation technique you use will determine what you have to do to make it work in unreal

right now it’s just done by scaling and transform, no skeletal meah bones

hmmi dont know the right technique in unreal for that. maybe morph targets?

If you are scaling the whole flower all at the same time and not specific vertices or faces then you can actually do that in Unreal with a non-animated static mesh using a Timeline component in your blueprint and you would only need to import the flower model without the maya animation data. you could just create the animationusing that timeline node in unreal.

but if the scaling is different parts of the flower at a time like stem grows then stops as leaves shoot out then those stop and petals bloom, then you will have to do some more preparation in Maya and import to unreal each stage of the flower’s growth as a morph target or whatever it is called, and i am afraid i dont know the workflow for that. there might be an easier way too but alas i dont know. can someone else answer this?

maybe i’ll re do the animation using a skeletal rig. if i would go with this direction how would i trigger the animation on particle hit on mesh (soil in the pot)

You’ll need two things:

  1. In the flower blueprint or level blueprint, get a reference to the flower’s mesh component, pull a wire from that to make a Play Animation node (I think that’s what it’s called), and you set up which animation to play there. Maybe you need to check whether it’s already playing too so it doesn’t restart when another water particle hits it.

  2. You need an event to fire when the particle hits the flower. This part I don’t know how to do. I have done collisions between other Actors but I haven’t done any particle collision events. But once you find out, have the hit event handler run the procedure from #1 above.
    You can go one of two ways:

  • Have the particle detect the collision and call the event on the flower actor, and the event will run the procedure from #1 above.
  • or have the flower detect the collision and check that it came from the particles, and if it did, turn on its own animation using the procedure from #1 above.

we couldn’t figure this out unfortunately, we’re instead just using a line trace that shoots when the player holds the watering pot at a certain degree for now.