#damn do i have like to delete all of it

1 messages · Page 1 of 1 (latest)

silent crest
#

here lets use a thread so we don't flood.
show me what the prefab looks like

vestal hull
#

these right?

silent crest
#

you only need 1

#

and needs to be Image component, so ideally create one inside the grid and make a prefab out of that

vestal hull
#

so i dont need it to be prefab? only just a sprite image?

silent crest
#

not sprite image, Image component

#

sprite renderer is something else

vestal hull
#

my guy just straight out created a mechanics T.T

#

fukin based

#

wait let me analyze

silent crest
#

i already done this a while ago

#

its a word game

#

thast why i offered this advice 🙂 been there done that

vestal hull
#

oh sick, but the word game im making is spelling any english with the given randomized letters

would it be the same or no?

silent crest
#

the game isn't the same. but the same knowledge /ways can apply

#

mine is just hangman

vestal hull
#

I attached one prefab

silent crest
silent crest
vestal hull
silent crest
vestal hull
#

ohh awesome alright

#

raw image? or just image

silent crest
#

just image

vestal hull
#

alright it worked!

#

damn bro

#

so how do I like randomly generate letters once this scene loads up

silent crest
#

here mine

silent crest
#

this is something I can use gpt real quick watch

#

never use it for code

#

just to write bs text like this

vestal hull
#

man the codes im using came from gpt

silent crest
#

nah its shitty

vestal hull
#

for spawner

silent crest
#

char[] alphabetArray = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray()

#

just this

vestal hull
#

ik i have no idea how it works

#

bruh fr

silent crest
#

char randomLetter = alphabetArray[Random.Range(0, alphabetArray.Length)]

#

easy stuff

vestal hull
#

so this happens and i cant move any of the letters

vestal hull
silent crest
vestal hull
#

oh wait it does move lol

#

wait imma readjust

silent crest
#

and yeah u could move them using UI methods too

vestal hull
#

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

silent crest
#

right

#

you need something that manages this logic

vestal hull
#

okay how do i like fill this box with letters

vestal hull
silent crest
#

you have to learn how to work with strings/chars

silent crest
#

as child of grid layout

vestal hull
#

i mean some of it are just given letters or fill out missing letters like crosswords etc

silent crest
#

did u see my gif example how I placed all of them

vestal hull
#

yah, im watching it atm

silent crest
vestal hull
#

oooh i understand now

silent crest
#

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

vestal hull
#

thanks man, ill work on it

ill contact you if thats alright?

vestal hull
# silent crest you need something that manages this logic

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

silent crest
#

anyways g2g , you can @ me tomorrow

vestal hull
#

alright thanks man this really helps me t odayy

vestal hull
silent crest
#

whatsup

vestal hull
#

hey man so im stuck on randomly generating the letter tiles, my teammate code one for me but idk didnt work lol

vestal hull
silent crest
#

why so many prefabs still?

vestal hull
#

thats from the code my team wanted me to use

#

but its not working

silent crest
#

🤷‍♂️ I can't tell what that means

vestal hull
#

but i can just disregard this

silent crest
#

what isn't working exactly

vestal hull
#

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

silent crest
#

!code

sterile pumiceBOT
vestal hull
#

I see

silent crest
#

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

vestal hull
#

wait imma try to remove all of these

silent crest
#

the only thing you'd have to do is make an aray of sprites and add your sprites there

#

just swap out the sprites

vestal hull
#

ooh yeah so those letter sprites spawn instead of prefab?

silent crest
#

are you spawning them before hand in the grid or you can spawn 1 at a time?

vestal hull
#

i kinda wnat it to spawn once it triggers to go to this scene

silent crest
#

i pretty much sent you my scripts to kinda study on

vestal hull
#

i meant

#

yeah

silent crest
#

so why is letter spwaning itself

vestal hull
#

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

silent crest
#

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

vestal hull
#

I understand man, i appreciate the help i am learning as I make this game

silent crest
#

no problem. Give those example scripts a look, shouldn't be hard to figure out.
goodluck friendUnityChanSalute

vestal hull
#

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

silent crest
vestal hull
#

nvm i got it working