Quantcast
Channel: Answers by "Democide"
Viewing all articles
Browse latest Browse all 10

Answer by Martin Sharkbomb

$
0
0
Another way to handle this, which works well if your objects don't move, is to save the position of the object before you start the animation. Like so: startPosition = transform.localPosition; animation.Play("testAnim"); Then during LateUpdate, you jus add that position on top of the position of your object, which effectively shifts it by it's original position. Since htis happens in LateUpdate it happens AFTER the animation offset was applied, maintaining the animation. Like this: void LateUpdate() { transform.localPosition += startPosition; } Since this offset is static this only works with non-moving objects. Of course you could modify this startPosition to move the object but it get's a bit more roundabout then. Hope this helps :)

Viewing all articles
Browse latest Browse all 10

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>