Slide button based on "User Interface - Stats Counter"

I want to use written names in one script, and use them in another not to copy it several times in different codes if I want to add or delete smth…

So you need to be able to use one script’s data in another script?

Yes)

Then you can look into events to communicate b/w two scripts. https://developer.playcanvas.com/en/user-manual/scripting/communication/

You have to do something like this above the initialize function of one script:

var SlideButtonText = “text”;

And you can change that in a function of another script if you need:

SlideButtonText = “new text”;

Or in your case maybe something like this:

SlideButtonText = this.scene1.toString();

But I’m not sure how to do that correctly.

Here’s a project that does something similar to what you are looking for: https://playcanvas.com/project/685077/overview

1 Like

Hi,

Yesssss this is exactly what I neeeeed! :grinning: :slightly_smiling_face: :upside_down_face: :+1: :+1: :+1: :+1: