/r/Unity3D

Photograph via snooOG

A subreddit for News, Help, Resources, and Conversation regarding Unity, the game engine


News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.

Remember to check out /r/unity2D for any 2D specific questions and conversation!


Download Latest Unity

Rules and Wiki


Please refer to our Wiki before posting! And be sure to flair your post appropriately.

Main Index

Rules and Guidelines

Flair Definitions

FAQ

Chat Rooms


Use the chat room if you're new to Unity or have a quick question. Lots of professionals hang out there.

/r/Unity3D Discord

FreeNode IRC Chatroom

Helpful Unity3D Links


Official Unity Website

Unity3d's Tutorial Modules

Unity Answers

Unify Community Wiki

Unity Game Engine Syllabus (Getting Started Guide)

50 Tips and Best Practices for Unity (2016 Edition)

Unity Execution Order of Event Functions

Using Version Control with Unity3d (Mercurial)

Related Subreddits


/r/Unity2D

/r/UnityAssets

/r/Unity_tutorials

/r/GameDev

/r/Justgamedevthings (New!)

/r/Gamedesign

/r/Indiegames

/r/Playmygame

/r/LearnProgramming

/r/Oculus

/r/Blender

/r/Devblogs

Tutorials


Brackeys

  • Beginner to Intermediate

  • 5 to 15 minutes

  • Concise tutorials. Videos are mostly self contained.

Sebastian Lague

  • Beginner to Advanced

  • 10 to 20 minutes

  • Medium length tutorials. Videos are usually a part of a series.

Catlike Coding

  • Intermediate to Advanced

  • Text-based. Lots of graphics/shader programming tutorials in addition to "normal" C# tutorials. Normally part of a series.

Makin' Stuff Look Good

  • Intermediate to Advanced

  • 10 minutes

  • Almost entirely shader tutorials. Favors theory over implementation but leaves source in video description. Videos are always self contained.

Quill18Creates

  • Beginner to Advanced

  • 30 minutes to 2 hours.

  • Minimal editing. Mostly C#. Covers wide range of topics. Long series.

Misc. Resources


Halisavakis Shaders Archive

Infallible Code

World of Zero

Board to Bits

Holistic3d

Unity3d College

Jabrils

Polycount Wiki

The Big List Of Game Design

PS4 controller map for Unity3d

Colin's Bear Animation

¡DICE!


CSS created by Sean O'Dowd @nicetrysean [Website], Maintained and updated by Louis Hong /u/loolo78

Reddit Logo created by /u/big-ish from /r/redditlogos!

/r/Unity3D

390,409 Subscribers

1

Camera follow In Unity: Cinemachine Tutorial

0 Comments
2024/11/09
09:18 UTC

1

NavMeshAgent is not stopping

Hi everyone, I am trying to make a simulation and I need to spawn in capsules (navagents) which will wander randomly trying to collect food on a plane

using NUnit.Framework.Interfaces;
using Unity.AI.Navigation;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.AI;

public class randomMove : MonoBehaviour
{
    private float timer;
    public float newtarget;
    public float speed;
    private NavMeshAgent agent;
    private Vector3 target;
    private Object plane;
    private float x_bound, z_bound;
    private float energy = 30.0f;
    private int numFood = 0;

    // Start is called once before the first execution of Update after the MonoBehaviour is created
    void Start()
    {
        agent = gameObject.GetComponent<NavMeshAgent>();
        plane = agent.navMeshOwner;
        x_bound = plane.GetComponent<MeshCollider>().bounds.size.x;
        z_bound = plane.GetComponent<MeshCollider>().bounds.size.z;
        x_bound /= 2;
        z_bound /= 2;
        //search for food
        //moves once every newtarget seconds
        timer += Time.deltaTime;
        if(timer >= newtarget)
        {
            newTarget();
            timer = 0;
        }
        //loses energy
        energy -= Time.deltaTime;
    }

    // Update is called once per frame
    void Update()
    {
        if(energy<=0)
        {
            this.gameObject.SetActive(false);
        }
        if(numFood <= 0)
        {
            //search for food
            //moves once every newtarget seconds
            timer += Time.deltaTime;
            if(timer >= newtarget)
            {
                newTarget();
                timer = 0;
            }
            //loses energy
            energy -= Time.deltaTime;
        }
        if(numFood > 0)
        {
            if(checkBounds())
            {
                agent.ResetPath();
                agent.velocity = Vector3.zero;
                agent.isStopped = true;
            }
            else
            {
                //moves once every newtarget seconds
                timer += Time.deltaTime;
                if(timer >= newtarget)
                {
                    newTarget();
                    timer = 0;
                }
                //loses energy
                energy -= Time.deltaTime;
            }
        }
    }

    void newTarget()
    {

        float newX = Random.Range(-x_bound, x_bound);
        float newZ = Random.Range(-z_bound, z_bound);

        target = new Vector3(newX, gameObject.transform.position.y, newZ);
        agent.SetDestination(target);
    }

    void OnTriggerEnter(Collider other)
    {
        if(other.CompareTag("food"))
        {
            numFood++;
            other.gameObject.SetActive(false);
        }
    }

    bool checkBounds()
    {
        var xPos = agent.transform.position.x;
        var zPos = agent.transform.position.z;
        return xPos == x_bound || xPos == -x_bound || zPos == z_bound || zPos == -z_bound;
    }
}

its a bit lengthy but essentially I want the capsules to stop at the edge of the plane (or at the boundary) if they have collected 1 or more food but no matter how I try I just cant get it to work, the capsules do stop if they are at the edge but immediately move off again and idk what is wrong with my code

Help is very much appreciated

1 Comment
2024/11/09
09:09 UTC

2

Crossword puzzle generator

One day I was making my own game and I wanted the level to be generated automatically. There is a set of words, the level should generate the best random crossword puzzle. What do I mean by the word best? The crossword puzzle should look like a square. It took a bit of time, but I did it. This algorithm has been tested on 23380 levels in English and Russian languages.

https://reddit.com/link/1gn5qde/video/4l6b4bs37uzd1/player

Here is the link:

https://yandex.com/games/app/353971?utm_source=app_page

0 Comments
2024/11/09
08:33 UTC

1

See previous selection in the inspector?

Hello everyone,

When I click on an object in the hierarchy view and then see the object in the inspector as well. Now I click on an audio file in the project view by mistake and as a result I see stuff about the audio file in the inspector. Is there a way to go back to the previous selection of the object, without looking for the object and reselecting it manually?

I asked ChatGPT and it suggested ctrl+[ for Windows, but it's not working (I'm on Unity 6).

Thanks in advance

2 Comments
2024/11/09
08:33 UTC

1

Unity Full Screen Pass Render Feature causing transparency issues

Hello all,

I am using a forward render for my project and currently have a render texture that displays an animated 3d model. I recently added a full screen pass render feature and now the background of my render texture is blue. If I remove that feature, it goes away.

Is there any fix for this where I can keep my render feature but remove the blue background?

render texture camera

0 Comments
2024/11/09
07:38 UTC

0

Coming soon on steam

0 Comments
2024/11/09
07:30 UTC

0

Resources for project structure and meta programming tools

I am new to the Unity/C# scene. Are there any good resources on structuring a project, test cases, and other plugins/libraries that’s recommended for development? Any must have plugins, conventions etc.

I use Unity to create VR apps mainly using the Meta XR SDK

0 Comments
2024/11/09
07:14 UTC

78

I'm about to lose control... any help ?

43 Comments
2024/11/09
06:48 UTC

1

How do i make it to where the move tool thing is always on the object ive selected?

1 Comment
2024/11/09
05:50 UTC

0

I finally built the AI that shows you how to do anything in Unity!

3 Comments
2024/11/09
03:48 UTC

1

Procedural tree Generation

Dose anyone have a good tutorial on how to procedurally generate trees? when I look nothing works when i follow them but for the life of me i cant get it

edit: I am using Sebastian Lague's procedural generation, with a few edits to the falloff map to make it more custom and a fixed noise map. And i am using Unity 2022.3.49f1

0 Comments
2024/11/09
02:15 UTC

1

Help with a movement shooter

I am trying to make a movement shooter. I'm not sure if I should use the character controller or rigidbody. I am currently using rigidbody and am not sure I should apply drag or cap the speed. When I cap the speed you can't go fast, which is the point of a movement shooter. Thanks.

2 Comments
2024/11/09
02:01 UTC

1

Good tutorials for mirror and steam?

Found one by zyger but it’s outdated and I can’t get it to work now, I was hoping somewhere out there there would be a in depth document or video. Something that doesn’t show me what to do but tells me why and how to do it

4 Comments
2024/11/09
01:54 UTC

1

When I am in unity, I cant create a new project.

i just downloaded it and am new so i dont know what is going on. the project lookes like it is creating and has a loading wheel but then just deletes it self and goes to the no projects yet screen

1 Comment
2024/11/09
00:58 UTC

1

Modify Terrain Layer Weights Using Timeline?

Is it possible to modify terrain layer weights using Timeline?

Research indicates there once existed a Terrain Control Track within the Terrain Tools Package, but that this no longer exists.

I'm interested in accomplishing this either via traditional timeline or the Microverse third-party asset package. Can anyone offer possible paths for achieving the outcome of modifying Terrain Texture Layer Weights using Timeline?

0 Comments
2024/11/09
00:57 UTC

0

107 FREE Unity Assets (November 2024 - Asset Store)

1 Comment
2024/11/09
00:44 UTC

0

Is it possible to create a program that can import and work on 3D files?

Hi, I'm a beginner in game development. A few years ago, I completed some small projects, but now I need to create a program for work that imports a 3D file and does some simple calculations.Since I already have some experience with the interface, I wanted to try using Unity. I’m having trouble allowing the user who will be running the program to import a 3D file (I'm trying with .stl). I made a script that asks to select a file to import but when i do so it imports an empty object.I wanted to know if this action is possible and, if so, if you could give me any tips on which path could i follow throw to work on it. Thanks a lot in advance!

5 Comments
2024/11/08
23:55 UTC

1

How to create a popup window to play video with option for fullscreen?

New to Unity and this forum, so let me know if there’s another place to ask this.

I need to be able to click a button, have a window pop up and autoplay a video. I would like to include standard play/pause/scrub timeline/full screen options for users. I’ve followed a bunch of tutorials on making a standalone fullscreen video, or a windowed video, but I’m failing to connect the dots and get the result I’m looking for.

7 Comments
2024/11/08
23:25 UTC

2

Unity 6 Installation Validation Failed

So I've a fresh install of Unity Hub and trying to install Unity 6 but this keeps happening...

https://preview.redd.it/px1gb473erzd1.png?width=792&format=png&auto=webp&s=ef8fc61fe592b85fb2c21a44500943f424ca67f4

I've done the following in an attempt to clear the issue:

  • Uninstalled the hub and reinstalled it twice.
  • Removed all appdata in Unity Hub and Unity folders.
  • Esured there's enough space (the drive has 200GB+ remaining.

Any help would really be appreciated!

3 Comments
2024/11/08
23:06 UTC

109

I'm so proud of this shot

I've been building a larger level in Unity, and it's been such a struggle to make the environment look believable and lived in. Even though this shot is still very much WIP, I'm very proud of the way things look so far. What would you add to this shot?

11 Comments
2024/11/08
22:12 UTC

9

Working on a morning light setup!

0 Comments
2024/11/08
22:03 UTC

0

Blender model to Unity - Question

https://preview.redd.it/1jweit5hmqzd1.png?width=1055&format=png&auto=webp&s=002171f45a7b61ce4be327caed372aa71f485fdb

i have this room (its a model from SCPCB), and screenshot is what i call 'cells', they will be copied and pasted over about 10 times across this room, but the problem is when if i need to change one thing about a cell.

i learned about linking, which worked fine, but in unity the naming will look terrible, which happens to be the linked objects.

https://preview.redd.it/1ws1qg7xmqzd1.png?width=327&format=png&auto=webp&s=4899bf028f6ca0a5de696a59f12608f5dae44629

(using a .blend file in unity, fbx does the same)

so what other option, or some parementer to remove these "CellCollection|Name-misc-class"?
or no option at all?
If i dont use links, and then need to change a cell, will have to change to every single one manually. I tried to use 'link' in this local project but it does not let me copy and paste the local as linked, unsure what to do im not experienced.

https://preview.redd.it/u62f55dqpqzd1.png?width=378&format=png&auto=webp&s=a7c6870bde91b59402bfbf34d8d92e10df2a8114

1 Comment
2024/11/08
20:50 UTC

0

Why is transform.rotation randomly not doing anything? I have a coroutine that moves and rotates a unit along a path, and when it reaches the end I want to set the rotation back to facing right. And the problem is not that it doesn't work, but it only does it sometimes and I'm losing my mind why?

4 Comments
2024/11/08
20:44 UTC

0

Hello, How can i add a normal map to this shader ? and where to put it ? Thanks :)

2 Comments
2024/11/08
20:02 UTC

184

Is there a way to get my model to look like this in Unity?

Hello everyone, I’m a beginner in both Blender and Unity and was wondering if I could get my model imported into Unity while still looking like this.

I wanted to have my model just be like here where light doesn’t affect the textures and I tried importing it into Unity before, but it just imported with no textures so it was all gray. I use emission for my texture here in blender if that helps.

Thank you for your time.

18 Comments
2024/11/08
19:56 UTC

1

Is there a dedicated way to put database into Unity project and use it?

It might be a really dumb question but I want to know if there's a way to put database into the Unity project which could work for both iOS and Android. I can't find or most thing I found are all community based ones which is discontinued years ago.

20 Comments
2024/11/08
19:54 UTC

1

Unity Audio Source Issues

Hey, does anyone happen to know the max amount of audio source clips allowed in Unity for a vrchat world. My audio was working great at about 140 audio sources (it's a large horror map world with 5 different sections in the woods) but now at 148 audios only about 5 of them work. I have each audio attached to a 3d cube. Can you attach more than one audio to an object and would that help or make no difference. Also I don't really understand the priority slider. All my priorities are set to 128. Would changing those help? I need them all playing at once as it's optional which section you go to. Is there a way to only get it to play when someone is near to it maybe? Sorry for so many questions. Any advice would be really appreciated. Thanks

0 Comments
2024/11/08
19:47 UTC

Back To Top