I'd like to perform this animation through a script but I do not know how:
https://imgur.com/a/8hsiiWL
I do not find any information on how to play a legacy animation using PlayCustom in the scripting guide. Any help is appreciated
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
In AC, "legacy" refers to Unity's old Animation component - so for info on manipulating it through script you'll want to refer to Unity's Script Reference pages here:
https://docs.unity3d.com/ScriptReference/Animation.html
However, AC does provides a helper function, PlayAnimClip, that can be used to play legacy animation clips on an object. This is what the Action calls when the Play Custom method is used:
Thanks, because the
myAnimation
andmyAnimationClip
were more confusing to me than using some code I found and modifying it to suit my needs this is what I came up with just for reference if someone else wants to animate via C# as well:This is actually for picking up an item and then teleporting it to another position to hide it. Teleporting should only happen after the animation has finished.
Probably some better way to do it but sufficient for me