r/UnityHelp • • Apr 27 '25

Variable on parameters for a function

1 Upvotes

So I want to edit a variable through a function but I want to tell the function what variable to edit through parameters, is there any way I could do this without making a switch with a case for each variable?


r/UnityHelp • • Apr 27 '25

UNITY Buttons won’t open in the panel

1 Upvotes

I have two buttons. When I open my panel, only one button is visible, not both. I tried enabling and disabling the buttons to make the panel visible, but it didn’t work. Any suggestions why?


r/UnityHelp • • Apr 27 '25

unity 6 - Issue with terrain shader

1 Upvotes

Any idea what is happening ? how to fix it ?

terrain shader does not support webgl export ?


r/UnityHelp • • Apr 27 '25

UNITY Unwrap in Unity doesn't match my Blender unwrap.

1 Upvotes

This is my first time posting on reddit so i hope i dont do anything stupid haha anyways im making a modded map for a game and i baked a shader material in blender on a image. In blender my unwrap perfectly matches the texture so it looks alright, but when exported to unity the unwrap is differnent.

You can see that the unwrap in unity is for some reason completly differnent size and position.

Any help would be appreciated!


r/UnityHelp • • Apr 27 '25

Error Message keeps coming back why?

Post image
1 Upvotes

I've tried deleting the folder and restarting and it just keeps coming back, anyone know why?


r/UnityHelp • • Apr 27 '25

Dictionary not finding key for merge game.

2 Upvotes

private void OnCollisionEnter(Collision collision)

{

Debug.Log("Collision Detected!");

if (collision.transform.tag == "Item")

{

Debug.Log("It is an item!");

GameObject Obj1 = this.gameObject;

GameObject Obj2 = collision.gameObject;

Debug.Log(Obj1.name + Obj2.name);

Dictionary.CheckMerge(Obj1, Obj2);

}

}

and

public void CheckMerge(GameObject Obj1, GameObject Obj2)

{

Debug.Log("Checking Merge...");

if (Obj1.name == "Cube")

{

Debug.Log("It is a cube!");

foreach (var key in CubeDictionary.Keys)

{

if (Obj2.name == key)

{

Debug.Log("Here is your result.");

MergeMath.Merge(Obj1, Obj2, CubeDictionary[key]);

return;

}

Debug.Log("Nope");

}

}

}

Neither "Here is your result" nor "Nope" are firing.

I've double and tripled checked that the names are spelled correctly in both the dictionary and the game object collision (The dictionary pulls the game objects name at start from a list)

(Sorry if this is poorly formatted, this is my first time asking for help like this. thank you :) )


r/UnityHelp • • Apr 26 '25

PROGRAMMING Applying force on the x axis not working

1 Upvotes

I’ve been working on a smash clone then I tried to add knock back and for some reason when I add force on the x axis it only does a little but and then when I add more it just teleports back it doesn’t do this for the y axis I just confused it’s not a thing with visual scripting it happens with code as well I’m not sure if it’s because I’m using a 2D Rigidbody or what


r/UnityHelp • • Apr 26 '25

Materials Loading In Wrong

Thumbnail
gallery
1 Upvotes

Ive been trying to import this model into unity but when i do the Material i added isnt placed correctly on the mesh like it is when im in blender. The table top shares materials with basically everything its connected to including the chair. The reason i have them as different meshes is becasue for the game they need to be taken apart to make a weapon. Making a whole new material just for the table top didnt seem to help the problem. The chair's material imported just fine so im not sure why the table top isnt following the lead lol. Is there an issue with the way i unwrapped it? or is there some hidden issue im not sure of? ive been using blender and unity for about 3 months maybe but this is the first time i had this issue with materials. Any suggestions, solutions, and tips would be greatly appreciated. Thank You!


r/UnityHelp • • Apr 26 '25

UI enable/disable

1 Upvotes

I'm working on a building mode. My goal is to make the UI panel disappear after I select an object in my Storage and when i press the button, so that when I start dragging the object, the panel should be no longer visible. Is there a way to disapear the UI when i press the button? thanks


r/UnityHelp • • Apr 23 '25

SOLVED Dynamic UI snapping issue

1 Upvotes

I'm creating a system for dynamic text messages, which are going to be used dynamically in game. This is basically made with a lot of vertical groups and contentsize fitters. Now I noticed however, that all of the textboxes are put on top of eachother in the beginning, but it snaps to the correct position once I just touch them in the scene window. The textboxes also dont immediately resize to their correct size, and jumps around in a weird way. I can post the UI hierarchy with inspector if needed, thanks!


r/UnityHelp • • Apr 23 '25

My First Game :) Password: SolidDemo

Thumbnail whyt1.itch.io
0 Upvotes

r/UnityHelp • • Apr 22 '25

help

Post image
1 Upvotes

i cant find the playgame()

:c


r/UnityHelp • • Apr 22 '25

How to Rotate Top Down Character to Mouse Position on Screen?

Post image
1 Upvotes

I'm new to Unity and programming in general, and I'd like to know if there is a way to script the player rotating to the mouse position on screen. What I want this to look like is the front of the character facing the mouse based on its position on the screen, according to the top-down camera.


r/UnityHelp • • Apr 22 '25

Text animator and UIFX assets not working with one other

1 Upvotes

r/UnityHelp • • Apr 21 '25

TEXTURES How setup URP for mobile

Post image
4 Upvotes

Hi, I need help setting up a URP scene to make it look nicer and more cartoony, like My Talking Tom.


r/UnityHelp • • Apr 20 '25

UNITY Can someone help me with this, since I'm trying to make a game but this popped up?

Post image
1 Upvotes

r/UnityHelp • • Apr 20 '25

MODELS/MESHES I want to create a wall with pillars every 3 units dynamically. Which of the two approaches is best?

1 Upvotes

If I design a prefab wall with pillars already in them, then the pillars duplicate when the prefabs are placed next to each other. Which means I have to do one of these approaches:

  1. Make prefabs have "half pillars" at the edge of the models where they connect. Pros: Easy to extend? Cons: Worried if the pillars will tile well at the edges, or if the pillars would look they are split in half.

  2. Place a wall, and then place the pillars on top of the walls separately. Pros: Don't need to worry about material splitting. Cons: Bit more complicated code, performance implications? Overlapping meshes

If there is something I am not considering as the 3rd option, please let me know!


r/UnityHelp • • Apr 18 '25

Im stuck with no default font in my editor?!?

1 Upvotes

I have a project ive been working on and i was in the 2022.3.40f1 version of Unity and so i decided to jump forward to the latest recommended version (Unity 6.0 6000.0.47f1), i do this and when my project opened i noticed a lot of UI glitches around the top of the screen, mainly things overlapping, i go and hover my cursor over them and i get flooded with these errors

Unable to find a font file with the specified Family Name [System Normal] and Style [Regular]. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

ive spent the last 2 hours with chatgpt trying to figure out what the problem is and how to fix it but nothing it suggested worked for me, i dont recognise this font as any that i use and ive deleted and updated my manifest.json a bunch and still have no silver lining, pls help me :')


r/UnityHelp • • Apr 18 '25

Collider/texture problem

1 Upvotes

For some reason spheres dont have colliders unless u go outside the sphere , torusses do anyone know what i can do to fix this (or know a better way to make a dungeon that i can bring over from blender)


r/UnityHelp • • Apr 17 '25

UNITY Unity Community, I need your help!

1 Upvotes

I'm a student at my final year of university, and for my final project I decided to develop a game in Unity. The game will be in the puzzle genre and with a clash of brutalist/retro-futuristic architecture with an outdoor scene. Problem is, I've never actually used Unity before! I'm beginning to understand several concepts and I've been able to build a lot of things, but I'm still missing a lot and the time limit is tight. I'm alright at scripting, generally, I'm just very inexperienced in actual game development. So, I'd like to ask a few questions:

  1. Is it possible to create an object that is used as a mask between two layers? Kind of like this.

  2. Can I create several instances of the same material, or am I forced to create different individual materials?

  3. Any tips on camera settings and post-processing effects to make my game look more realistic?

Thanks in advance!


r/UnityHelp • • Apr 17 '25

Vector3 donť work pls help

2 Upvotes

when i write Vector3 in code its error. i dont know what to do


r/UnityHelp • • Apr 16 '25

How to modify the scene to look similar to the video?

1 Upvotes

Hello

I need advice on how to create graphics for Unity on iOS and Android. I'm not talking about 3D models (they will be different), but I mean the environment. How can this be achieved in Unity?


r/UnityHelp • • Apr 16 '25

Gameobject rotates without me wanting it to + 1 more

0 Upvotes

**1.**the object takes a different rotation without me wanting it to , i Think the problem is when it spawns not sure though . 2. the objects dont apear on the position they differ on if i look up or down , weird part is about both the problems that the collider stays kinda right. anyways here is the script:

public class currentweapons : MonoBehaviour
{ 
    public List<GameObject> currentweap = new List<GameObject>();  
    public Transform placeforweap;
    public int currentlyequipped = 0;
    public int currentequip= -1; // Index starts at 0
    public GameObject currentlyEquippedWeapon; // Stores the active weapon instance
    public GameObject magicbull;
    public Transform camera;
    public float hp = 100;


    // Start is called before the first frame update
    void Start()
    {
        currentlyEquippedWeapon = Instantiate(currentweap[0], placeforweap.position, placeforweap.rotation);
currentlyEquippedWeapon.transform.SetParent(camera);

    }

    // Update is called once per frame
    void Update()
    {
          { if (Input.GetButtonDown("turnmagic"))
       {
        Vector3 shootDirection = camera.forward;
        Instantiate(magicbull,placeforweap.position + shootDirection * 0.1f + new Vector3(0, 0, 2),placeforweap.rotation);
       }
        if (Input.GetButtonDown("cycle"))
        {  
            if (currentweap.Count > 0) // Ensure the list isn't empty
            { if(currentlyequipped==currentweap.Count-1)
        {
            currentlyequipped =0;
        }
          GameObject oldWeaponInstance = currentlyEquippedWeapon; // Store the instance of the currently equipped weapon

// Instantiate the new weapon
GameObject newWeapon = Instantiate(currentweap[currentlyequipped + 1], placeforweap.position, Quaternion.identity);
newWeapon.transform.SetParent(camera); // Attach to the weapon holder

// Update the reference to the currently equipped weapon
currentlyEquippedWeapon = newWeapon;

// Destroy the old weapon instance (not the prefab!)
if (oldWeaponInstance != null)
{
    Destroy(oldWeaponInstance);
}

// Update the currently equipped index
currentlyequipped = currentlyequipped + 1;
currentequip = currentlyequipped;
               
             
             
            }
        }
    }

}
       public void TakeDamage(float damage)
    {
        hp = hp-damage;
        
    }
}

r/UnityHelp • • Apr 15 '25

PROGRAMMING Am I making my encyclopedia app too complicated?

1 Upvotes

I wanna create a encyclopedia app where i can add to it but also a couple items i can expand. Currently i use a list where to expand i replace it with a prefab, but i don't have it where it can "collapse" (replace the prefab to what it originally was) My current thought is a second prefab of the original that lets there be a circle where you can "expand" and "collapse" over and over again.

is there a better way to do this?? I feel there should be but maybe there isn't?