All posts by B

Make it so only audio gets built that is needed

Now that I’ve started putting my projects together (which makes life SO MUCH BETTER at least for now), I run the risk of making everything unnecessarily large by including all of the audio in any individual build.

This is bc Unity auto includes anything under the Resources folder.

Apparently you can rename folders to have ~ first but that seems to have mixed reviews on forums.

First I need to separate out audio by which app it’s in, and then script to go to that specific folder inside Resources instead of just Resources.



Answer colliders for ShortLongA

Now I need some sort of feedback system for ShortLongA. It shouldn’t be a show/hide button like in Vowel Teams, but instead some sort of thing where it lists how many need to be changed, or circles them (but then it’s just move it to the other one … might still be worth it).

Excited to usertest the answer feedback function in this.

In my heart of hearts, I really want a recording feature for the hard mode, where kids then record their own reading of the word. But this is going to require some significant backend. There’s an inbetween version where then they compare their recording to the right answer, but that could be tricky without a tutor and without it saved somewhere for teachers to look at / use.


Standardize across game templates

So now that I have pulling in the .txt file variables working, I need to tell it which  .txt file to bring in.

So far I’ve done this by adding a gameobject to each scene named & tagged “SceneType”. It has a textmesh component with the rendering turned off, and the name of the .txt file in it.

This way, for any given scene, it can still have the same scripts attached to it, and it finds the correct .txt

Note – I have it done pretty redundantly right now. There are 2-liners pulling this in in the exact same way in the following scripts:

  • GameManager.InitGame()
  • WordDictAdd.SetUp()
  • WordDictAdd.CreateObjects()
  • LoadEasyMode.Propogate()
    • [which, should be noted, should also switch names etc. #todo]
  • GoMenuVowelTeams.MainMenu()
    • [#todo also should change names]

GameManager.InitGame() is my first attempt to make this so it doens’t have to be repeated.

Hmm. So this isn’t working as smoothly as I wanted it to. This might be a good instance to run it by Joao.

A thing I’d also like to know is if making an empty game object with a non-rendered textmesh that tags the scene is the way I’m supposed to do it.

Ooh – apparently there’s multi-scene editing, that sounds nice.  #todo

Some interesting food for thought around using names and stuff:

  • against:
  • pro

#todo – I could have the same menu scene for everything, but I’m not sure that’s worth it right now. It feels like it would make it hard to make builds and my energy really isn’t going into menu stuff right now. Eventually maybe.

Add in sounds depending on easy/hard mode:

  • right now this mainly happens in GetButtonLevel, where it checks if it has an easy tag, and if so, adds sounds
    • complication: for VowelTeams, answers is always in there. (this could just be a standardized thing I have, where anything tagged answers is always there…)
  • It also happens in GameManager.Awake() so that any scene I start with will have sounds without having to go through the menu

This makes me think I want to have this information embedded into my text file, so that I don’t have to individually specify it every time.


Use .txt column variables in scene

Command R replaces everything in the script. Exit to cancel, enter to keep.

Now I’m working on automating pulling in the column names, creating the things they need from those, and inserting htem into everything. This is basically WordDictAdd.SetUpOnsets. I want this for a couple reasons – 1, the script was super repetitive. 2, making new templates with this system is a real pain, and involves an annoying amount of manually find&replacing. Feels like I shouldn’t need a python script to do this, I can do it inside C# Unity itself.

Okay – so first goal – bring in the names of the columns and return them.



  • name GameObject[] sets using the string
    • This is a little tricky.
    • OH – I don’t need to name them separately. They’re just object sets. They don’t need the name embedded the way they do in the hard code.

To fix:

Turned off InitGame SetUpOnsets in several places (Propogate on the main camera, and also in GameMnaager when it starts)

I also took out the level name, which is a real pain. So now I should go back and add in the level name but make it so it skips it in the set


Random thoughts on how to do more specific feedback in the future:

  • have a set of answer objects in each slot, that get filled in by the Reader, to have the textmesh of the right answer block
  • then, if they are currently colliding with something that has the same textmesh, they are correct. (tehy can be colliding with more than one thing – if there is a correct thing colliding with them, it works) – #todo – the only problem with this is this feasibly could have them out of order but marked as correct -play around with this

Okay, so now I’ve got it working for VowelTeams.

I’ve imported ShortLongA scene to see how this can translate. A thing I think I now need to do is to tag each scene with which .txt file it uses, so I can use the same gameManager prefab. This wouldn’t be necessary if it weren’t in the same project, so I should consider this. I’m pretty sure it’s better to be in the same project tho so that if I change any of the main scripts, they’re always changed, instead of having so many versions of them runn


Fix up button levels

Now that everything else is working, I need to pull the level from the button name and call that row from the spreadsheet.

Annoying thing I just discovered. Prefabs for buttons, where you add the script in the scene that it needs – they don’t work, bc the prefabs are outside the context of the scene. To have that work, I think I’d need it just be attached scripts, bc that works. Maybe I’ll consider switching my buttons to not really use the button functions that are context-dependent, and just do added script components.

Lol silly indexing problem. Button #1 is taking it to row[1], which is actually row 2. I guess I need to subtract one from it?

Make audio present or absent based on type of scene

Okay, so in PuzzleBot, here are the ways that audio interacts:

  • In NameButton.GoOneLearn() (which is attached to the main camera and called upon click inside the button component): public void GoOneLearn()
            // change GM instance audioList & score to be the ones you want in that level

            GameManager.instance.scoreValue = 5; 

This requires that there is a thing in GameManager called audioList. Let’s go look at that.

  • GameManager only has thing thing, setting up audioList but never using it.
    •     public List<string> audioList = new List<string>();

Okay, so what script winds up calling audioList? Is it PlaySound?

Nope, PlaySound doesn’t’ call it.

Ahhhhh – it’s in PlayerCoroutine. Because PlaySound isn’t even attached to those objects!!!! WHOAH CRAZY. PlayerCoroutine() is attached to each of the objects that should (or shouldn’t) make sounds. And it’s not that no sound is attached – it actually attaches and plays a blank sound. This feels like a hack but whatever 😉 Keep things consistent. (Maybe come back and look at it #todo).

void PlayAudio()

        TextMesh onsetText = gameObject.GetComponent<TextMesh>();
        AudioSource audioSource = gameObject.GetComponent<AudioSource>(); // script doesnt like this for ones where its not there 

        if (audioSource == null) // consider just adding audio to game components at beginning of game? not sure theres a diff 
            audioSource = (AudioSource)gameObject.AddComponent<AudioSource>();

        if (GameManager.instance.audioList.Contains(gameObject.tag))
            audioSource.clip = Resources.Load(Sounds/ + onsetText.text) as AudioClip;
            audioSource.clip = Resources.Load(Sounds/blank) as AudioClip;





Ohhh okay. In Vowel Teams, the script on the menu buttons is called ButtonLoadScene.Propogate()

Interesting. Now my Check answers button is broken. I bet this is because I deleted a damn prefab. Hmm… actually it just looks like it’s because something got confused with the text showing up in front of that button and in front of the Answers buttons. It was working at enabling and un-enabling the mesh renderers, it’s just the z scales were off. I wonder if it’s something to do with how I redid any of the prefabs? It really shouldn’t have broken those, but I fussed with the text z scale and that didn’t fix it, and then I ALSO fussed with button z scale, and that DID fix it. Weirdly, I think I only fussed with the CheckButton z scales, and when those got fixed, so did the answer buttons. Huh. Let’s keep an eye on that. #todo (And maybe come back and confirm that that’s done right.)

Okay, so I moved the thing adding audio onto the GetButtonLevel() which is attached to the button scripts, so that I can use tags on the buttons to indicate which one should have which audio.

It’s not perfect, but I’ve got everything set up now.



Make middles work

SetUpOnsets() only sets up the onsets (a la the name), so I need another function that does Middles.

Woooo I did it! A thing I’d like to do is go back to WordDictAdd.SetUpOnsets() and script the super repetitive stuff. I never learned how to do that and that’d be a thing that’d make me happy to do. #todo

I’d also like to go back and see why GameManager.instance.levelCounter isn’t working where I thought it should have. I had to call GameManager.InitGame() an additional time in the Propogate.cs script to make it so the menu buttons worked.

Note: I also had to reset each of the counters inside Start() in WordDictAdd, or else they got too high and stopped calling the right index.


Trigger Check Answers button to appear

So now that I have the show/hide button working, and I know how to trigger collisions, I need to make the button only show up when each of the slots has been filled.

A question for myself:

  • does each slot need to be filled with a like color?
    • I’m not going to do this for now. I want to see how kids interact with it, and if they start learning the patterns on there own without too many initial restrictions.

Implementation questions:

  • how do I make sure that the slot is actually being filled, rather than just having been collided with?
  • Do I have the collisions/fillings count to 15, and on 15, the button shows up?
    • This could be something where if there are 15 collisions simultaneously, then the check button appears
  • Or do I have something arranged more individually, box collider by box collider …
  •  Or, this might not exactly be about collisions, but about slots being filled

This is a super cute interaction, and might be useful for me to reread in the future:

A lot of stuff was recommending Physics.OverlapSphere , which does maybe what I want but with a sphere.

I looked in the rest of the Physics command, and found Physics.CheckBox

This might be it – gonna give it a shot.

Joao just suggested these too ideas:

  • there’s also OnTriggerExit (cool I didn’t know!!!), so I could tally on trigger enters and on trigger exits and when it hits 15, I know they’re done

Boolean – is something placed here?

  • Joao also pointed out – but what if a letter block overlaps two box colliders 🙁 Which will almost definitely happen, unless I really change how I’m doing this, and I don’t want to bc I don’t want it to be too rigid bc it’s like 6 year-olds using this

OHHHH – I only need a single box collider, over the entire frame where the answer slots are, and then all I need is for all of the letter blocks to be inside it. Doesn’t need to be 15, doesn’t need to be individualized, just once all of the letter blocks collide or overlap with it simultaneously, then the check box appears. Really cool how that idea occurred to me while talking with Joao! Social thinking about coding problems is helpful and happy.

Hmmm … blocks are getting stuck in the box collider.

Keeping Track of Targets in a Trigger

Do I want a script on the collider block, or a script on each of the letter blocks? (Or … no matter where the script is, what direction is it going in – for every letter block, is it in the collider currently? )

blocks are getting stuck in the box collider:

PROBLEM: Because raycast from Move Object and Play Sound was hitting the box collider instead.
SOLUTION : move box collider to -1000, and then it works again.
This could also be potentially solved by using Raycast All, which might end up being necessary if there’s no way to satisfy all the z requirements.

So I’ve gotten it down to the point that being left in the boxcollider is making the letter blocks freeze and not be consistent about playing their own sounds. This happens even when I remove my collision script. I’ve removed the sprite component, rigidbody2D, and checked and unchecked “istrigger”. Hoping that the site below helps. This feels oddly familiar and maybe like something I’ve solved in the past, possibly in PuzzleBot.

When you raycast, it figures out all the things that are intersecting it. So it finds the first object (box collider) instead of finding the letters block (which it needs to in order for Move Object and Play Sound).

Raycast – can always deal with z things by just looking at all of the things. Raycast can give a bunch of different objects. –> there’s a Raycast All, which gives you a bunch of Raycast hits, which I can try to use at some point if my z stuff gets sad.

#todo – so keep an eye on if it ever happens that the order z needs to be in for every different thing isn’t possible.



make it so blocks don’t overlap so weirdly: 

PROBLEM: blocks overlap weirdly bc they’re all at the same z level, which means that the text overlaps with one of the colors behind it. It looks strange and isn’t useful.
SOLUTION: Make onsets a different z level (10) than middles (20), which should be a different z level than codas (30).


Render Check/Hide button when all 15 are in the box collider

For this one, I can use the same render script I used for the answer text inside the Check/Hide button itself.

Okay, so now I need to access the Check/Hide button from the collider.  OR I could put the collider script on the Check/Hide button.

Okay I need the collider script on the collider bc of this:

    void OnTriggerEnter2D(Collider2D other)

So instead I’m going to use this:

Noooo this is still for gameobjects, not for buttons.

Huh – why is the child of the button not getting enabled? I’ll just hack it and enable it specifically in the code.


Show/hide button

So now I’m thinking that I shouldn’t use z to have the text be behind the buttons, but instead have it be the mesh renderer be enabled or disabled depending on need, by tag, like I used to do in the other Show/Hide button.

I made the show/hide button work to render and not render the answers over the answer flashcards!

It requires that the answers be tagged as “Answer”, so the prefab will need to be updated for that. #todo

#todo – I would also like the text to look more child-friendly.

A cool thing is that in googling this rendering thing, I also found the function at the bottom, that toggles the rendering every second. I’d like to use that to remind users to hit buttons – or at least at the start, to hit the first answer button. #todo

There’s a chance I might be better off with a brief tutorial, but the flashing buttons could be a segue (or could be good in addition to it).

The next thing I want to do for the show/hide button is :

  • only have it appear when all of the box colliders for the answer slots are filled in (what if there has been a collision but it hasn’t *stayed* there)
  • and then have the name of the show button change to “hide” in context – and change the name to “check” instead of show
  • make the show/hide button look more attractive
  • make it flash when it shows up, and say “check your answers!”
  • after that, it’d be nice if there were a tally of how many correct slots you did – __/15.
  • but it’s unclear how much some of those goals matter in comparison to getting it massively expanded in terms of content

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Show : MonoBehaviour
    private Renderer rend;
    Button myButton;
    private GameObject[] AnswerTexts;

    void Start()

        myButton = GetComponent<Button>(); // access button component 
        myButton.onClick.AddListener(() => ShowHide());
        AnswerTexts = GameObject.FindGameObjectsWithTag(Answer);
        Debug.Log (Answer);   

        foreach (GameObject answer in AnswerTexts) 
            rend = answer.GetComponent<Renderer>();
            rend.enabled = true;

//                    r.enabled = false;


        void ShowHide()
    //        GameObject[] consClusts = GameObject.FindGameObjectsWithTag(ConsCluster);
            foreach (GameObject answer in AnswerTexts)
                if (answer.GetComponent<MeshRenderer>().enabled == true)
                    answer.GetComponent<MeshRenderer>().enabled = false;
                    foreach (Renderer r in answer.GetComponentsInChildren<Renderer>())
                        r.enabled = false;
                else if (answer.GetComponent<MeshRenderer>().enabled == false)
                    answer.GetComponent<MeshRenderer>().enabled = true;
                    foreach (Renderer r in answer.GetComponentsInChildren<Renderer>())
                            r.enabled = true;

//    // Toggle the Objects visibility each second.
//    void Update()
//    {
//        // Find out whether current second is odd or even
//        bool oddeven = Mathf.FloorToInt(Time.time) % 2 == 0;
//        // Enable renderer accordingly
//        rend.enabled = oddeven;
//    }






Making better prefabs

Before, I did a thing that probably wasn’t the most advisable – have a mesh for the background of my buttons, with the color material added on, and then scaled it like crazy to make it the size I wanted. That was then embedded in my prefabs for each moveable letter.

Unsurprisingly, this got wonky in the following ways:

  • every time unity updates, it lost its link to the material, or to the prefab, and turned bright pink
  • it was scaled bonkers-like, making all other scaling around it really annoying (particularly since text, notoriously tricky to scale, is involved)
  • It just didn’t seem like the most elegant way to do this

So today I finally decided to fix this. I didn’t do it in the most elegant way, but I used Grab to get the color and shape out of it (I actually like the color and shape for a beginning draft, and it’s what I prototyped with and it worked, so no need to change it now). I checked the scale size on Unity to find out that it was approximately 4/3 x/y. Then I sized and resized it in GIMP, and brought each png back as a prefab and compared. Wound up being pretty perfect at GIMP’s canvas size 122 x 88 pixels at 144 ppi.


I believe that I can’t add in prefabs after the fact – is that true?…615.615.0.3390.….0…1.1.64.psy-ab..0.0.0.HlFg82oOUVE

I followed these instructions to get my textmesh to appear above my new 2D sprite. The textmesh is childed to the sprite. The sprite is Z=0, textmesh is Z= -1.

The sprite I’m using is from the png onset-block-updated-122-88.  I’m going to child that to an empty game object just named “1” so that my scripts work with the onsets.

With the textmesh childed to the sprite, the sprite is no longer involved in the scale shenanigans I’ve been using to make the font quality look nice. I’d like to return to this, and to try out TextMeshPro again, bc this is some buuuullshit that I have to do this wonky thing with the text and there HAS to be a better way, right?

Alright, now I have an empty gameobject parent (1), that has childed to it the sprite (onset-block-updated-122-88) [gotta name that better] and the text (Text).

It needs the following components:

  • Box Collider 2D [for Move Object Script]
  • Rigid Body 2D [for Move Object Script]
  • Move Object Script
  • Play Sound Child Script

This way, the children only have one component each. For the sprite, it’s just a sprite renderer. For the text, it’s just the textmesh.

Hopefully this will keep it simpler!

So on the one hand, my next goal could be:

Completing this for all of the prefabs inside this scene, so that everything looks beautiful. That includes:

  • middle block (same as onset but different color)
  • end block (same as onset but different color)
  • 3 answer slots
  • flashcard (this one is particularly inelegant, with the textmesh offscreen – I should probably just make the textmesh in the back, and I could consider having a button to press to show the answers (which should only be possible if all the answer slots are filled in)
    • This is an exciting idea, because it’s one step easier than checking the answers and giving feedback. It basically just gives *you* the answer, and then you can correct it. Not sure how this would work with kids, but there’s a chance it’d be good. It’s at least a thing to make and see how it works – maybe the feedback system isn’t even necessary and this is enough. But at the least it’d be a useful step as a comparison in prototyping.
    • This is also useful to think through because when I redo the flashcard, it should be with this in mind.
    • Also, how do kids know they’re supposed to press the flashcard? Wouldn’t that be nice if it was more obvious, or if there was a brief tutorial

Question for self – if I have the textmesh overlaying the sprites as *part* of the prefab, will that mean that when/if I change the prefab, I’ll have to change all of the text again? That feels unfair. And feels like it relates back to – I should have the text brought in automatically. Maybe I should go ahead and build it that way, and hope that I can do it well and it passes the app store. Cuz otherwise I’m going to spend an ungodly amount of time putting text in.

Hm. Nah. One thing at a time, Brittany. Let’s get this in the app store and build up features from there.

Next step – make a good prefab for the middle bits.

  • get png from the onset
  • get Grab of the middle block, to get the color
  • use GIMP to change the purple to orange
  • save as .xcf
  • export as .png
  • put in sprites

Then, make a duplicate of the onset prefab, rename to middle, and switch out the sprite. Everything else should be the same.

#todo – this is probably a great instance of a branching prefab. Or a linked prefab. I don’t know how to do those, so I’m just going to have them be entirely independent. Excited to someday make these link up.

As part of this, I should decide on some naming conventions and keep them stable. For instance “onset-block-updated-122-88” is not a great name. It should probably just be

  • onset-block-122-88


  • OnsetBlock

Unsure if I should keep in it what size it is, bc it was actually a real pain to figure out the size. I think that means I keep it in. How about:


That feels optimally clear without looking too awful. Still looks kinda bad. Okay I’m gonna try that out with the middle blocks and see if it feels good.

Actually it looks like textmesh content doesn’t change with prefabs. This is GREAT news for me in this instance – I just realized my textmesh color was grey-ish, and that it was making the blocks look weird. I changed the onset prefab textmesh color to white (FFFFFFFF) and ALL of the onsets changed. Didn’t need to even press any buttons. YAY

Current question:

what should z be on gameobject

I dislike how when I zoom in on a gameobject, it disappears bc of where its z is. That’s a frustrating thing to happen in a 2D space, but I guess I get it. #todo – I’m unsure what to put my z objects at. It feels weird to put them artificially back (z = high positive number like 20) just so that I can zoom in, but it’s also annoying having them disappear when I zoom. I don’t really understand spacial relationships very well so this might be interacting with it.

Also somehow all my onset collider boxes are totally off. Gonna see if changing the prefab works. YAY – I couldn’t change the collider box *in* the prefab, but I made an instance of it in my scene, changed the collider box, and hit “Apply” and everything else changed. Crucially, the textmesh contents did NOT change (like before). This is very exciting.

So I need to change the sprite names, both under Onsets AND middle block. cuz they both wound up being wacky. Going to finish Ends first.

Curious, I’d never noticed before that the end blocks were a different size than the others. Or, I noticed, and didn’t care, cuz this was some pretty rapid prototyping that I’m leveling up!

Alright, this is good progress. Slow, but good. Gonna take a 30-min lunch break and set this laptop aside so I get out of work mode. And charge this laptop, too. Maybe it’d be good for me to switch locations after lunch.

Nevermind, the kitten’s asleep on my foot, so I’m never moving again. The only things in reach are popcorn, red wine, and my computer, so I think I’m all set! Time to get working again.

  • onset: purple, hex color : 8A3FE7FF
  • middle: orange, hex color : F85757FF (I think?)
  • coda: green, hex color : 3BCC36FF

I don’t *quite* know how to put that into GIMP, but it seems to be working to just use the grab method followed by color picker.

#todo – make kerning / vertical and horizontal centering consistent with fonts on these buttons. In the meantime, I’m going to just eyeball it.

Okay I just want to reiterate that now that I learned how to deploy prefabs better, they are AMAZING HOLY COW. This little “apply” button is the BEST THING EVER.

#todo – related to kerning, I might need to have different prefabs for different widths of texts, if I want this to be automatic. OR I can just do it manually for a while. It really doesn’t interfere with anything, and I believe that having automated feedback would be FAR more desired by teachers than having the kerning be perfect. So let’s keep to our priorities here!

Okay, so possibly instead of having just the answer block as prefab, I should maybe have the entire answer situation (3 colorful slots + block) as prefab. That way they’ll each look the same. This argument could also be made for onset, middle, and coda rows, but I’m not sure about it yet. It feels right-er for the answer portion, but I can’t pinpoint exactly why.

Ooh now that my z numbers aren’t bonkers, I can zoom in on everything. Was that actually just because they weren’t even, and it was messing with it? Can’t say for sure but whatever it is, this is nicer this way.

Okay, so when all the blanks are filled in, there can be a big “check your work” button. This avoids having kids try to press the button before finishing. It’s not ideal, because it may encourage them to hit it and get the answers – so something about the feedback system will eventually want to be encouraging them to do self-reflection.

#todo Plan for giving feedback: I’ll start just giving them the answers. Then I’ll move on to saying how many they got right on the first try, then the second try (and recording it somewhere, so that they’re encouraged to go back and check their work before pressing the button), then I’ll potentially move on to automated/guided feedback.

#todo Gosh I gotta fix the appearance of my menu. It’s needlessly html-looking.

I wonder if I should try to just get a single scene into the app store, or if I should try to get a small menu up and running. That might make more sense, and look less like a Beta version. Although if that doesn’t work, I can always go back to the single scene version.


Thing to fix – now that they’re all beautifully in the same z spot, they actually overlap each other in disturbing and distracting ways. Fix this soon.

#todo : make prefabs for quiet blocks that don’t have playsound script on them

wth is “graphic raycaster script” on the menu? Without it the buttons don’t work. Fascinating.

I removed “Canvas scaler” and it still works, but doesn’t get rid of the 2 yield signs “the rferenced script on this behavior is missing” and “the reerenced scirpt on this bheavior (Game Object “) is missing!

So I put canvas scaler back on cuz I think that has something to do with how the canvas appears on different pieces of technology.

Okay, so now I’ve got it reduced down to just 3 levels, and it’s mad at me for something about the buttons in the menu.

WOOOOO I FIGURED IT OUT it was something about the Menu button inside the levels. Basically when the scene loaded it seems to have noticed that the Menu button’s script was defunct, and then threw a warning. Odd that it didn’t show up when the level was loaded by itself (as opposed to through a button on the menu), but that’s okay – I feel pretty good about being able to find errors like that faster now.

That being said, there’s apparently this magic script that can go find them – but after about 30 seconds of trying to use it, I couldn’t figure out how to.

Finding Missing References in Unity

#todo – at some point I’d love to figure out how to use this as a tool. Wasn’t worth the rabbit hole this time tho.

Do I need to compress the audio and/or delete all the audio that’s not immediately relevant? That might be worth it, keep the size down.

Now I’m going to the backup copy to find out what words were in the other scenes, since I totally messed with these. Backups are important!

I’d like to go make mockups of everything, with the content in it, so that if smething happens iwth Unity, it just isn’t a big deal.

8/17 – So yesterday evening around 6:30PM I finished getting it set up pretty-like with 3 levels (2 difficulties each) and a single menu screen. No errors or warnings!

Today my goal is to start the process of getting it on the app store. This is going to be pretty painstaking so I’m going to keep careful logs of it and be patient with myself.


Make answer blocks buttons

Guys!!! OMG OMG OMG. I’m pretty psyched bc when I was thinking about some sort of app store preview, I realized that it would be better if the answer blocks were buttons and were shaded when you pressed them.

Sooo I quickly whipped that up in my app, used the prefab, and then made the necessary alterations!

  • made a button the size I wanted (155×53 in Unity width/height, but there’s some scaling stuff going on from being a child of other stuff … honestly I’m not super sure I understand this but I’m at least writing what I did)
  • used the source image AnswerBlock190x88 (unsure if this is necessary)
  • in Button Script, made the pressed color darker (A9A9A9FF)
  • The button is childed to each number instance under Answers. Text is a separate child (This may be wrong, but I wanted to keep using my textmesh script … should probably make this simpler at some point #todo)
  • Then, I put the entire Answers chunk under Canvas (it won’t show up unless you do that, since it’s UI entities)
  • Changed z numbers to the following:
    • Answers: 0
    • Button: -1 (as long as it’s a lower number than Text, it will hide the Text)
    • Text: 0