Trying to have a button when pressed randomly generates 5 numbers, but I am getting an error that says Text has no receiver

This is supposed to generate 5 random numbers but it gets a no receiver error.


From the images you posted it looks like you haven’t attached your Random component script to the “rngBUtton” object.

You should first add the Random component script you made. Then use that component in the onClick handler for your button component.

Are you sure the method gets called in the first place? Because it doesn’t seem like you are calling the right method in the ‘OnClick’ event