- Home /
Difference between scripting animation wrapmode and setting it from inspector.
Hi,
This might be silly but I'm seeing this in code and would like to the difference. In some codes, I've code written as:
void Start() {
car.animation.wrapMode = WrapMode.Loop;
car.animation ["idle"].layer = -1;
car.animation.SyncLayer (-1);
car.animation ["Straight"].layer = -1;
car.animation ["Straight"].wrapMode = WrapMode.Loop;
car.animation ["left"].layer = -1;
car.animation ["left"].wrapMode = WrapMode.ClampForever;
car.animation ["right"].layer = -1;
car.animation ["right"].wrapMode = WrapMode.ClampForever;
}
In the docs, setting the layer is basically setting which animation is distributed first. As for the wrapMode, is it better to do this in code or to just set the wrapMode in the inspector?
Comment