#damn do i have like to delete all of it
1 messages · Page 1 of 1 (latest)
you only need 1
and needs to be Image component, so ideally create one inside the grid and make a prefab out of that
so i dont need it to be prefab? only just a sprite image?
you need it to be prefab yes
not sprite image, Image component
sprite renderer is something else
i already done this a while ago
its a word game
thast why i offered this advice 🙂 been there done that
oh sick, but the word game im making is spelling any english with the given randomized letters
would it be the same or no?
the game isn't the same. but the same knowledge /ways can apply
mine is just hangman
I attached one prefab
attach an Image component to it
wait are the words random?
they're randomly chosen
just image
alright it worked!
damn bro
so how do I like randomly generate letters once this scene loads up
here mine
pick them from an array
this is something I can use gpt real quick watch
never use it for code
just to write bs text like this
man the codes im using came from gpt
nah its shitty
for spawner
char randomLetter = alphabetArray[Random.Range(0, alphabetArray.Length)]
easy stuff
so this happens and i cant move any of the letters
will check on it, but does gpt help like on some codes right?
ehh its not very good
and yeah u could move them using UI methods too
do i have to use spawner for the letters?
well the goal of the game im making is
when you spelled a correct english word
the used letters will disappear and generates a random letters again back in the box
okay how do i like fill this box with letters
cant f ind any good forums surrounding this kind of logic :<
any word game really
you have to learn how to work with strings/chars
no they have to go in the grid.
as child of grid layout
i mean some of it are just given letters or fill out missing letters like crosswords etc
did u see my gif example how I placed all of them
yah, im watching it atm
oooh i understand now
GameManager script
var keyLetter = Instantiate(letterPrefab, gridLayout); keyLetter.letter= alphabetArray[Random.Range(0, alphabetArray.Length)] ; keyLetter .AddGameManager(this); keyLetter .SubTOButton();
public class ButtonKey : MonoBehaviour
{
public string buttonKeyText;
public char letter;
public Button buttonKey;
public TextMeshProUGUI textButton;
public GameObject disabledButtn;
private GameManager gameManager;
public void AddGameManager(GameManager _gameManager)
{
gameManager = _gameManager;
}
public void SubTOButton()
{
buttonKey.onClick.AddListener(SendSignalToGM);
}
public void DisableButton()
{
disabledButtn.SetActive(true);
}
public void DisabledButtonCorrect()
{
var c = new Color32(8, 208, 42, 255);
buttonKey.image.color = c;
buttonKey.enabled = false;
}
void SendSignalToGM()
{
if(gameManager != null)
gameManager.SendButtonMessageChar(letter, this);
}```
its old but I would do it different now
passing char in the method directly is better than a bunch of public fields but w/e it was for a jam
anyway g2g
goodluck with your endeavor

thanks man, ill work on it
ill contact you if thats alright?
apologies for taking your time, i meant right now i just want the letters to generate randomly in a 8x2
8 letters above and 8 letters down
and seen on your gif, do i have to clone just one prefab letter? (is duplicate the same or na)
Thats what i meant
put them in as place holders so you can size the grid enough to fit 8 and 8 then you can remove them /spawn them with the letter spawner
anyways g2g , you can @ me tomorrow
alright thanks man this really helps me t odayy
Are you available?🤔
whatsup
hey man so im stuck on randomly generating the letter tiles, my teammate code one for me but idk didnt work lol
bit shite, doing great, you fam?
🤷♂️ I can't tell what that means
but i can just disregard this
what isn't working exactly
i removed it, cause i spent whole night on this lmao
supposedly the prefabs on Letter Prefabs is where randomized spawn occur
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class RandomLetterTileSpawner : MonoBehaviour
{
public GameObject[] letterPrefabs; // Assign Letter_A to Letter_Z prefabs
public Image spawnImage; // Assign the Image component directly
private void Start()
{
SpawnRandomLetterTile();
}
void SpawnRandomLetterTile()
{
if (letterPrefabs.Length == 0 || spawnImage == null)
{
Debug.LogWarning("Assign letter prefabs and a spawn point.");
return;
}
int randomIndex = Random.Range(0, letterPrefabs.Length);
GameObject randomLetter = Instantiate(letterPrefabs[randomIndex], spawnImage.transform);
randomLetter.transform.localPosition = Vector3.zero;
}
}
wait how do i
post it
the way you posted yours
!code
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
dont really see the point of doing this
like i already explained , there has to be a main script that controls all this
doing it on each later itself you don't have an easy way to track them all
wait imma try to remove all of these
the only thing you'd have to do is make an aray of sprites and add your sprites there
just swap out the sprites
ooh yeah so those letter sprites spawn instead of prefab?
are you spawning them before hand in the grid or you can spawn 1 at a time?
i kinda wnat it to spawn once it triggers to go to this scene
i pretty much sent you my scripts to kinda study on
so why is letter spwaning itself
wdym? its the mechanic i want to apply
You spell an english word if its correct, the player model attacks
im a bit confuse wait xD
idk my suggestion is you learn a little bit more about unity/coding before doing this
you will struggle greatly, this isn't an easy game to make if you don't know the basics
I understand man, i appreciate the help i am learning as I make this game
no problem. Give those example scripts a look, shouldn't be hard to figure out.
goodluck friend
hey man so i got it working, how do I change the layer?
I meant this scene has a fade transition and the brown box is above the fade transition
huh the layer?
nvm i got it working