Entity reference is null [SOLVED (by magic)]

I’ve got an Entity “AnimationHolder” which is a Template Instance of an FBX with a camera motion path in it. I want to control the animation with a script.
I added an Anim, and set the State Graph… it plays when it is activated by default.
I’ve set up the code (using another project as a guide - I’m totally new to PlayCanvas) like this:

AnimationController.attributes.add("animationHolder", {type: "entity", array: false, default: [""], title: "Animation Holder"});

AnimationController.prototype.initialize = function() {
    console.log(this.animationHolder);
    this.animComponent = this.animationHolder.anim;
    this.animComponent.play("Take 001", 0);
};

Why is this.animationHolder always null?

(as a new user I can only embed one media image: here was a screen grab showing the settings in AnimationHolder)

(as a new user I can only embed one media image: here was a screen grab showing the link from animationController to AnimationHolder)

p.s. I wondered if it might be a race on initialize order, but that value is null forever if spammed through update too

I’m no further along with this, so I’m going to see if I can add the other media images in replies to my first post :smiley:

Yup, and here’s the last one:

image

Well, after lunch it starting working. No idea why, I didn’t touch it during lunch… maybe my browser was caching something (no, I had been updating the console logging constantly and it was reflecting the changes, plus I use ‘empty cache and hard reload’ on the page anyhow).