Hey y’all,
I’m trying to set up two characters to play an anim when the player looks at them. The goal is to have each one only play their respective anim once. I have a setup working well, but I’m wondering if there’s a simpler, more efficient way to go about it.
I wanted to see if I could simplify it by only using one Cast and one Play Montage. Since CharacterA and B are children of Character_PARENT, I was able to do this setup, with a couple issues…
Have each character only play their ‘instruct’ anim once (I’m doing this with Do Once nodes in the original setup, but now that there’s only one execution path, I can’t use that anymore)
Once both have played their anims, I want to close the Gate so that the Event Tick isn’t firing into the Trace and Cast every frame (which I haven’t figured out for the original setup yet, either)
so sorry for the delayed response. And, no worries if you don’t respond further. But, I wanted to clear up all my requests and saw this one that I didn’t respond to.
to answer your question: these anims only need to play once.
One way of doing it is to have a bool variable in the Character_Parent called Has Been Seen? which you set to true when you play the animation for the first time. You can also use that variable with a branch before you play the anim montage, that way it will only play once (when the value is false). To check if both characters have been looked at, you can have a counter variable on the player that is incremented every time you execute play anim montage and instead of the gate you can just have a branch that will do the whole logic only if the counter is less than 2.
this makes sense to me. I have pivoted away from the original project, but as soon as I can play around with this idea to confirm I understand it and it works, I’ll respond and resolve it.
thank you!