- Home /
Question by
coolblue2000 · Jun 12, 2018 at 09:20 AM ·
animation2d gametilemap
Tile Map tileAnimationData.animationStartTime not working as expected
I am trying to set some tiles to start their animations at different times so that they are not in sync with each other. So I tried setting the animationstarttime to a random value. However they are still in sync. I tried a very high max value to make sure that I could see the affect. There seems to be very little documentation regarding this property and what it actually does so I have no idea if what I am doing is correct.
This is my code that I use in the custom tile script
public override bool GetTileAnimationData(Vector3Int position, ITilemap tilemap, ref TileAnimationData tileAnimationData)
{
if (_animatedSprites.Length > 0)
{
tileAnimationData.animatedSprites = _animatedSprites;
tileAnimationData.animationSpeed = m_MinSpeed;
tileAnimationData.animationStartTime = Random.Range(0f, 10000f);
return true;
}
return false;
}
Comment