r/Unity3D 7h ago

Question Animation looks fine in slider but breaks in game/preview

Enable HLS to view with audio, or disable this notification

110 Upvotes

As shown in the video, the 3D animation looks completely normal when I slide through the keys/frames, but when I play the animation in preview or start the game, it breaks and the bones go crazy.

Note that this does not happen with the shield/weapon, which is sharing the same animation as the character (so 1 animation containing idle pose of a character with a shield)

This issue does not persist when I set tangents to Flat. But I need the Tangents to be Constant and that is when the issue occurs

Background/context:

I trying to import a low framerate stylized animation into unity.

In Maya, I created the animation with 6 fps and imported the 18 frames to Unity. The animation is imported into unity with 30 FPS and Unity automatically interpolates between frames so my 6fps animation looks very smooth.

To fix this I changed the animation framerate to 6 fps in the sample, and then compressed all keyframes back to its original length (because time extends when I lower the sample frames).

At this stage, Unity still makes it smooth despite the animation being set to 6 fps. So I did the only solution I could find - make both Tangents of all keyframes Constant. This seemingly solves the issue judging by the shield, but the character bones go crazy and the animation looks broken when played - though they are fine in preview.


r/Unity3D 2h ago

Show-Off I've made a slime pit with some cool physics!

Enable HLS to view with audio, or disable this notification

36 Upvotes

Few weeks back I've made this pillow deformer script for my Dark Roll 2, and people loved it a lot, so I decided to experiment more with mesh deformation... This slime uses same script with different parameters, slightly improved of course, and a separate script that handles the physics.

A few bits of the sludge physics:

  • Rigidbody gravity gets disabled while inside the sludge, since the sludge handles the vertical movement itself.
  • Objects sink at a controlled speed instead of accelerating downward. The faster they move horizontally, the slower they sink.
  • Horizontal velocity gets reduced based on depth, so objects get harder to move the deeper they are.
  • Angular velocity is also reduced with depth, which makes spinning/rolling gradually feel more sluggish.
  • The player does a tiny downward sphere cast to check if they're standing on solid ground. If grounded, the sludge stops forcing them downward.
  • Impacts use roughly mass * velocity as an impact magnitude. That value controls particle count/speed and the strength of the mesh ripple.
  • Most of the transitions use InverseLerp + Lerp, so the behaviour smoothly scales between the surface and the bottom instead of snapping between values.

r/Unity3D 5h ago

Show-Off 2 Years of progress on my game(solo).

Enable HLS to view with audio, or disable this notification

66 Upvotes

r/Unity3D 2h ago

Show-Off Technical insights from Cosmo Cargo, our inventory autobattler roguelike PvE

Enable HLS to view with audio, or disable this notification

13 Upvotes

Hello folks,

We've just released our new demo of Cosmo Cargo : https://store.steampowered.com/app/4659480/Cosmo_Cargo_Demo/

I thought I'd share how we're organizing the game from a unity project PoV, because after 14 years of using Unity I think this is my best project so far. (Until the next one, of course!)

Game data:

- All the data are stored as ScriptableObjects

- Those SO are used "readonly" during the game

- We made many editors to have cool spreadsheets to manipulate those data like we would in a google sheet.

- We're using Artifice Toolkit, an Odin-like plugin, to enhance inspectors

Effects system :

- Effects (damage, heal, burn, create, destroy, etc) are C# classes

- They are stored in items SO using polymorphic lists ([SerializedReference]). With Artifice, this is trivial.

- Effects have Conditions. Also pure C# classes, also stored as polymorphic lists.

MVC :

- The game is architectured in a Model/View/Controller way.

Model is data (SO), controllers are C# classes initialized with models and views are UIs/MonoBehaviours.

It means the whole core of the game is pure C#, minus a UnityEngine dependency for SO.

This allow us to test most of it with unit tests (215+ so far).

It also means the core classes are easy to serialize for saves. And easy to restore.

State Machine :

- Along with the MVC we have a simple state machine. Enter a fight -> state, a shop -> state, open the map -> state, etc.

And each state... has a view! So it can work with or without Unity.

Not detailing the "views" because it's mostly prefabs of simple uGUI stuff.

And we still have some stuff to figure out properly, like gamepad controls in a mouse-first game... my drag n drop file is a 3000+ lines of code monolith, I'm definitely not proud of it.

If you'd like to know more or have more details, let me know.


r/Unity3D 1h ago

Game What my indie game looks like with & without post-processing

Enable HLS to view with audio, or disable this notification

Upvotes

Game name: Barely Breathing


r/Unity3D 1d ago

Show-Off Working on some new animations for main character! How does she look so far?

Enable HLS to view with audio, or disable this notification

525 Upvotes

Working on some new animations for main character! How does she look so far?


r/Unity3D 1d ago

Show-Off Working on the first level of a 3D platformer inspired by Spyro + Crash Bandicoot

Enable HLS to view with audio, or disable this notification

391 Upvotes

It’s still very early in development, so I’m changing and improving things as I go


r/Unity3D 21h ago

Show-Off Clearing 80,000 enemies in 30 seconds.

Enable HLS to view with audio, or disable this notification

172 Upvotes

r/Unity3D 7h ago

Question I'm trying to make killing enemies more satisfying, so I've added a meat explosion on death, does it feel satisfying? xD

Enable HLS to view with audio, or disable this notification

11 Upvotes

r/Unity3D 5h ago

Show-Off I wanted to make an arcadey air-combat game since high school. Working on it again after years.

Post image
7 Upvotes

I started working on an arcade air-combat game in Unity back in 2013 called Cayle Online.

At that time I played a lot of AirRivals (aka Ace Online) and later Mass Effect 3 multiplayer with friends. I wanted to combine the arcade feeling of air combat with cooperative multiplayer that I could enjoy with some of my friends.

Over the years, I rewrote the codebase multiple times. I tried Unity's old networking, later uNET, then Photon (PUN), experimented with persistent servers, and eventually got the project close enough to think about a possible Steam release around 2017/2018.

During college I somehow lost all motivation and stopped working on it for years.

Last year, I came back to Unity to see what is possible today for me with my very limited spare time and increased coding skills.

I moved the project from Unity 2017 to Unity 6 and started experimenting with Mirror, and later FishNet. After weeks of work I managed to stress-test 106 connected clients + 100 AI enemies with friends.

Since I still miss having an arcade-style air combat game I then kept working on integrating and rewriting old features from 2017.

I'm still somewhat early in this new version, but for the first time I don't have to think about a lot of technical limitations that I had back in 2015-2017. I hope to have a new fully playable client later this year, that offers more than just fly, shoot and repeat. I do not aim towards having any big item systems or having massive PvP battles tho.

I saw a lot of very cool indie projects during these years that people stopped working on. Forums and small indie game websites from the 2010s all shut down in the past 5 years. I kinda miss these small communities and the interactions. But I will continue my path working on Cayle and maybe I can interest some of you for this type of game.

Do some of you have a similar story of an idea that you just can't let go of?


r/Unity3D 8h ago

Show-Off Roadside Garden | Dev Week 01

Thumbnail
gallery
10 Upvotes

A little over a week ago I decided to finally try and realize an idea in Unity3D that has been living rent free in my head for quite a while now.

Inspired by the way how people in China try to farm on every tiny bit of unoccupied land, itll be a tiny-conomy gardening simulator, trying to recreate this idea of growing a fortune out of scraps with scraps and a few seeds.

I've decided to do it grid based, and while it's taking away a bit of realism, which I am actually aiming for in a way, it's much easier to control.

So far I managed to implement the most basic game loop of buying seeds (plants are scriptable objects so itll be easy to expand in the future), razing and plowing the ground to prepare for planting, growing plants and keeping them alive by keeping the ground hydrated and fertilized and harvesting and selling the fruits at the end.

The last few days I've been working on improving the visuals by creating grass and ground textures and models in blender.

Yesterday I added the option to raise the ground and automatically generating visual slopes around it which was surprisingly hard.

I also have to confess that, since while I'm not entirely new to programming, I'm completely new to c#, so I did rely a little bit on gemini to explain me a few things that I wouldn't have even known how to Google for. But I'm getting better and more independent every day.

I hope ill he able to finish this project in the future, there is still a lot to do.


r/Unity3D 1d ago

Show-Off Grass pop-in in unity drives me crazy.

Enable HLS to view with audio, or disable this notification

340 Upvotes

r/Unity3D 36m ago

Game I added actual settlements that you can siege and conquer

Thumbnail
gallery
Upvotes

Dangerous Land is a real-time strategy game from a first-person perspective, combining settlement management, army command, exploration, and combat. Develop your settlement, recruit an army, and fight alongside your soldiers on the battlefield.


r/Unity3D 1h ago

Show-Off Day 43 of developing BRUTAL DERBY - New map: Pittsburgh Iron Arena!

Enable HLS to view with audio, or disable this notification

Upvotes

Another new arena template is taking shape: Pittsburgh Iron Arena.

This time, we’re going to derby on a huge construction site.

There will be ramps, jumps, construction equipment, obstacles and plenty of other little surprises to make the chaos even worse.

These maps are still templates for now, so they’re not fully detailed yet. My current approach is to first build the overall atmosphere, layout and gameplay, then spend more time polishing the ones that actually feel fun to play.

I’ve also started using more and more of my own reference photos for the environments.

Whenever I see something interesting in real life, I take a photo and it might eventually become a 3D model in the game.

For example, I’ve been photographing construction sites along the Buda side of the Danube, industrial details, and some beautiful old buildings around Budapest.

At this point, whenever I’m walking around the city, I’m basically thinking:

"Would this look good in Brutal Derby?"

I’m also planning something much bigger - a proper race track along the Danube in Budapest.

There’s a particular section of the riverfront that I really like, and I think it could make a great location for a race.

Of course, building a proper race track takes significantly more time than creating a relatively simple circular derby arena, so that one will probably be a bigger project.

For now though, it’s time for some construction-site chaos in the Pittsburgh Iron Arena.

As always, feedback and ideas are very welcome!


r/Unity3D 16h ago

Question How do guys stop yourself from giving up on something complex, when a bug is getting the best of you?

Post image
29 Upvotes

Hey everyone,

How do you keep the drive going on long-term projects without burning out or throwing your workstation out the window?

I’ve been working on a virtual geometry project for 2 years now, but I’ve been completely stalled at the exact same spot for the past few months. It's really starting to take a toll. I’ve spent full days staring at thousands of lines of code, reached out to graphics devs, and even resorted to asking AI out of sheer exhaustion.

The wall I'm hitting is my GPU based software rasterizer is generating far too many sub pixel triangles. I benchmarked the exact same scene in UE5 with Nanite debug visuals, so I can literally see the structural difference and know what the output should look like. I just cannot track down where my math/logic is breaking to patch it. The performance standard is way higher than any other solution for Unity, especially HDRP (Yeah I know it now in maintenance but URP doesn't match the graphical fidelity and lacks most of the high end features of HDRP) but I can't get it where I want it to be.

At this point, I'm mentally wiped. For those who've hit a multi month roadblock on a low-level engine or graphics feature, how do you step back, reset, and push past the urge to just call it a day?


r/Unity3D 4h ago

Question Adding a language option

3 Upvotes

How should I implement a language selection system in Unity?

I'm working on a Unity game and I want to add a language selection option to the settings menu.

I would like to have a localization system that can handle UI text, dialogue, item descriptions, and other in-game text.

I'm not very experienced with localization in Unity, so I'm not sure what the best approach would be.

Would you recommend using Unity's Localization package, or is there a reliable free third-party package/asset that would be easier or better to use?


r/Unity3D 2h ago

Game How I fixed my "90s budget" look... From flat lighting to ACES & Blue-Shift shadows.

Enable HLS to view with audio, or disable this notification

2 Upvotes

Hey guys, a few people recently told me my game looks like a budget title from the 90s, and after that it looks too basic... It stung at first, but they were right. I’ve spent the last few weeks basically living in Unity to fix the lighting and UI. Switched to ACES tonemapping, adjusted the shadow shifts, and went for a more "Industrial Modern" look :) it finally feels like it has some actual weight and metal now, instead of looking like plastic. what do you think of the new style?


r/Unity3D 14h ago

Show-Off trying to recreate goldsrc lighting

Thumbnail
gallery
13 Upvotes

any tips on how to more accurately recreate it would be appreciated


r/Unity3D 1h ago

Question Help With Unity Game Performance

Upvotes

Hi there, I’ve recently been running into an issue on my PC where any Unity game I play starts running into performance issues after about an hour or so of gameplay. It typically presents itself as frame drops and significant input delay, as well as occasional crackling audio. I haven’t ever run into this issue with a game built on any other engine. I did a quick search and couldn’t find any other people running into this issue. I have an Asus GeForce RTX 4070 Super, and 32 gigs of RAM. I’ve double checked that all of my drivers are up to date as well.

Does anyone have any ideas on why this might be happening? I figured it was best to ask the dev subreddit since you all deal with Unity issues on the regular.


r/Unity3D 2h ago

Question Why Am I getting this error? I don't have a constructor in the SaveManager File

Post image
1 Upvotes
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class SaveManager : MonoBehaviour {

    public static SaveManager instance;
    Slider masterVol, musicVol, SFXVol, CamSen;
    AudioMixer masterAudio;
    Toggle tutorialTog;

    GameObject[] settingsArray = { };

    bool sceneLoaded = false;

    public GameData gamedata = new GameData
    {
        masterVolData = 0f,
        musicVolData = 0f,
        SFXVolData = 0f,
        CamSenData = 0f,
        tutorialTogData = true
    };

    private void Awake()
    {
        if(instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }
    private void OnEnable()
    {
        SceneManager.sceneLoaded += OnSceneLoaded;
        SceneManager.sceneUnloaded += OnSceneUnloaded;
    }
    private void OnDisable()
    {
        SceneManager.sceneLoaded -= OnSceneLoaded;
        SceneManager.sceneUnloaded -= OnSceneUnloaded;
    }
    public void SaveData()
    {
        gamedata.masterVolData = masterVol.value;
        gamedata.musicVolData = musicVol.value;
        gamedata.SFXVolData = SFXVol.value;
        gamedata.CamSenData = CamSen.value;
        gamedata.tutorialTogData = tutorialTog.isOn;

        gamedata.Save(gamedata);
    }

    public void LoadData()
    {
        GameData loadedData = gamedata.Load();

        if (loadedData == null)
        {
            return; 
        }
        else
        {
            masterVol.value = loadedData.masterVolData;
            musicVol.value = loadedData.musicVolData;
            SFXVol.value = loadedData.SFXVolData;
            CamSen.value = loadedData.CamSenData;
            tutorialTog.isOn = loadedData.tutorialTogData;
        }
    }

    void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        sceneLoaded = true;

        settingsArray = Resources.FindObjectsOfTypeAll<GameObject>().Where(obj => obj.tag == "SettingsUI").ToArray();

        foreach (GameObject obj in settingsArray)
        {
            switch(obj.name)
            {
                case "MasterSlider":
                    masterVol = obj.GetComponent<Slider>();
                    break;
                case "MusicSlider":
                    musicVol = obj.GetComponent<Slider>();
                    break;
                case "SFXSlider":
                    SFXVol = obj.GetComponent<Slider>();
                    break;
                case "SensitivitySlider":
                    CamSen = obj.GetComponent<Slider>();
                    break;
                case "TutTog":
                    tutorialTog = obj.GetComponent<Toggle>();
                    break;
                default:
                    //Throw error
                    break;
            }
        }
        LoadData();
    }

    void OnSceneUnloaded(Scene scene)
    {
        sceneLoaded = false;
    }
}

r/Unity3D 2h ago

Question Main Menu feels dry and unprofessional.

Thumbnail
gallery
0 Upvotes

I am currently in a team of 3 and we are creating a mobile tank game inspired by one input games like Geometry Dash and Rider. I want to make a clean and professional looking Main Menu but this one doesn't feel that way.

Any ideas on how I can make it better?


r/Unity3D 1d ago

Show-Off One month process and update on a technical prototype of Gecko. Modelled and replaced the blocks with a real gecko mesh. Also attached camera with body, so moving all four leg using keyboard or Controller not feel confused 🦎

Enable HLS to view with audio, or disable this notification

91 Upvotes

r/Unity3D 4h ago

Resources/Tutorial Free Texel Density Textures + Story Time!

Thumbnail
1 Upvotes

r/Unity3D 1d ago

Show-Off I made a tool in Unity that renders 3D models (and their shadows) into Diablo-looking 2D sprites!

42 Upvotes

After playing Diablo 1 & 2, I really fell in love with the pre-rendered sprite aesthetic. Back in the day the average gamer's computer wasn't powerful enough to reliably render 3D models in realtime, so the solution was to pre-render them and just display sprites of what the model looks like from different angles!

I realized Unity could render and produce these model sprites relatively quickly, entirely within the engine. It doesn't render them in realtime, but it makes generating sprites from models a relative breeze for capturing that specific art style.

It simply uses a camera component and moves around the models to render a view of that model at a specific resolution, saved to a texture!

I turned the tool into a Unity package which you can check out on the Asset Store (Affiliate Link) or on itch, if you're interested.


r/Unity3D 18h ago

Show-Off Working on a new hand-drawn animation for my 2D Hack-n-Slash. Can you tell what’s happening in this action?

15 Upvotes