Creating text message on start of each level

hehe, a tad in the X/Y directions by the look of it - good spot :wink:

If it helps, here a screenshot from the zip file;

image

Now it works fine, so I just need to update my prefabs to have it work in all levels? Already gave it another, more prominent placing.
Thanks a lot

1 Like

Potentially, yes. But you could instead Find the LevelText GameObject in code instead.

Also, remember in the other topic I suggested perhaps the Ball wasn’t the best place for this, I note you have a GameplayController.cs script, you are using that to update the lives, being that this is a similar concept it would probably make more sense to move your functionality, now its working, to that script instead of the Ball.

Could of other thoughts…

At the moment you have a hand written value on each text object in each scene, so if you wanted to add another 100 levels, you are going to have to update all of those manually.

I’m assuming your scene build index looks a bit like this (I had to create this one manually as I didn’t have the project files etc);

image

If this is the case, where you have the Lose and Win scenes always at the end, and the Start scene at the beginning, then we could programmatically assuming that the build index value is equal to your Level number. So, rather than having to enter the value for the level each time, we could just grab it from the scene.

Or…

If you don’t want to rely on the order of the scene build index, you could instead grab the name of the current scene, split the name by the _ character, and then use the part to the right, concatenate it to the word "Level " and you’re done.

Any of these interest you as a way forward, or would you prefer to do them manually? Happy to offer a little more help if you want/need it… :slight_smile:

By the way, I’m going to merge this topic on to the previous one, as they are effectively the same thing.

Thats ok, for now I am going to do them manually and I come back to your suggestions when I get more experienced and try to tackle them myself, my original approach was in the LoseCollidor script, but the GameController sounds more logic, big thank you for your efforts. If I need help with this in the future I will post in here.
Should I set the topic to solved?

1 Like

No worries, it was just something I spotted. Many ways to achieve it to reduce how much you have to do within the Inspector etc.

Yeah, we can mark this topic as solved now and it will close. Just post again if you have any further questions/queries - its a friendly community :slight_smile:


Updated Wed Nov 29 2017 22:47

No need to use [Solved] in the topic title Rudi, there is the Solved functionality built into the forum, it places a tick icon by the topic :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms