![[3.3.2]TypeError: Cannot learn properties of null (studying ‘top’) of SpriteAtlas Sp – Cocos Creator [3.3.2]TypeError: Cannot learn properties of null (studying ‘top’) of SpriteAtlas Sp – Cocos Creator](https://thefuntrove.com/wp-content/uploads/https://discuss.cocos2d-x.org/uploads/default/original/3X/c/9/c9a024cd3656916ac85bb3a01034f8075bc8f827.png)
[ad_1]
TypeError: Cannot learn properties of null (studying ‘height’)
at ReelItemAni.MakePixelPerfect (ReelItemAni.ts:141:110)
at ReelItemAni.replace (ReelItemAni.ts:45:37)
at component-scheduler.ts:281:35
at ReusableInvoker._invoke (component-scheduler.ts:233:13)
at ReusableInvoker.invoke (component-scheduler.ts:195:14)
at ComponentScheduler.updatePhase (component-scheduler.ts:480:28)
at Director.tick (director.ts:746:37)
at callback (sport.ts:734:26)
After i run this system this error seems. The “height” property is on this technique:
public MakePixelPerfect(){
this.sprite.sizeMode = 0;
this.sprite.node.getComponent(UITransform).width = this.nWidth;
this.sprite.node.getComponent(UITransform).top = Math.flooring(this.nWidth * this.sprite.spriteFrame.top / this.sprite.spriteFrame.width);
}
I don’t know why. Please assist me. Thanks!
[ad_2]