I removed all added code to the script and reverted it back to the simple scaling script, and it still does it. So, I know it isn't any of my coding additions. And when I look at the [ImportedComponent] code itself, it seems to be looping through allot of things, and I'm wondering the prefab having multiple sub-models could be causing it to get stuck or fail.
Any ideas or assistance would be greatly appreciated. Am I as usual just not understanding how this works? I'm just thrown off because it doesn't affect prefabbed animals with only one sub-model and mesh renderer, and I get no error or log messages referencing anything about this.
Here is the script code:
Code: Select all
namespace DaggerfallWorkshop.Game.RandomVariations
{
[ImportedComponent]
public class HorseController : MonoBehaviour
{
[SerializeField]
private float min = 1f;
[SerializeField]
private float max = 1.25f;
private void Awake()
{
float scale = UnityEngine.Random.Range(min, max);
transform.localScale = Vector3.Scale(transform.localScale, new Vector3(scale, scale, scale));
}
}
}
Here is the first horse showing the attached script
Here is the second horse showing no attached script.