Grimmy
November 2, 2023, 2:16pm
1
Hi, I just started getting random tween errors in my game on nothing I’ve been working on. A new update arrived just a couple of hours ago so I’m guessing they may be connected. Especially as this happened a few months back.
I could be wrong of course but the errors are on scripts with tweens that I haven’t opened for weeks and are unconnected to my current work. Is anyone else getting issues?
Errors…
[main.js?id=125125687&branchId=3066db9f-2c18-4f85-8166-93aa92ed21e3:791] : Uncaught TypeError: this.opacityTween_OUT.start is not a function
TypeError: this.opacityTween_OUT.start is not a function
at https://launch.playcanvas.com/api/assets/files/Scripts/main.js?id=125125687&branchId=3066db9f-2c18-4f85-8166-93aa92ed21e3:791:35
ASSERT FAILED:
Texture height must be an integer number, got
[object Object]
1 Like
Grimmy
November 2, 2023, 2:22pm
2
I can confirm that going back to version 1.65.5 I don’t get any errors.
1.66.0 has errors
1.66.1 has errors
Grimmy
November 2, 2023, 2:37pm
4
Ok Thanks. So how can I fix it?
Grimmy
November 2, 2023, 2:47pm
7
Thanks. Quick question. If I have the following code…do I also need to get rid of the ‘bind’? eg…
.on('complete', function () {
//do stuff
}.bind(this))
to… :
.onComplete(() => {
//do stuff
}//no bind here?
Otherwise I get an IDE error.
Grimmy
November 2, 2023, 3:06pm
9
Thanks. I think a separate error cause by the update and not covered here is this error:
ASSERT FAILED:
Texture height must be an integer number, got
[object Object]
Any ideas how to resolve that one?
put a breakpoint to see what the problem is?
1 Like
Grimmy
November 2, 2023, 3:26pm
11
Thanks. I have some code as follows but following the upgrade hints the tween no longer works. How can I modify this code to work?
this.opacityTween_IN = this.entity.tween(this.opacityScreenFade).to({value: 1}, 0.5, pc.Linear)
.on('update', this.onFade, this);
I tried…
this.opacityTween_IN = this.entity.tween(this.opacityScreenFade)
.to({value: 1}, 0.5, pc.Linear)
.onUpdate(() => {this.onFade,this});
…but the fade no longer happens. No errors though…
LeXXik
November 2, 2023, 3:38pm
12
What is this () => {this.onFade,this}
? Use proper syntax, don’t try random stuff.
You need to pass it a function that would call your onFade
. One option:
.onUpdate(dt => this.onFade(dt))
My tween code is updated like below.
this.entity.tween(this.opacity).to({value: 1}, 3, pc.Linear).onUpdate(() => { this.onFade(); }).start();
1 Like
Grimmy
November 2, 2023, 6:58pm
14
Thank you all. It all works again now.
1 Like