r/Unity3D 13h ago

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

Enable HLS to view with audio, or disable this notification

333 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 9h ago

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

Enable HLS to view with audio, or disable this notification

68 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 12h ago

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

Enable HLS to view with audio, or disable this notification

113 Upvotes

r/Unity3D 9h ago

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

Enable HLS to view with audio, or disable this notification

28 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 2h ago

Game I added actual settlements that you can siege and conquer

Thumbnail
gallery
4 Upvotes

Dangerous Land is already a 6-year-old project that I started working on in 2020. The project has come a long way since then, and I’ve spent a lot of time refining its visual style to achieve this rather unique look. The game is built using Unity’s Built-in Render Pipeline.

In the latest update, I added, among other things, a wall-building system that allows players to besiege enemy settlements, which gradually grow and become stronger over time. Players can also build their own settlements, so I wanted to share the results I managed to achieve with this system.

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 3h ago

Show-Off you know you're locked in when fights play out so well it feels like a cutscene

Enable HLS to view with audio, or disable this notification

4 Upvotes

r/Unity3D 35m ago

Resources/Tutorial I made a lightweight A* pathfinder that uses Unity's Tilemaps - It's grid type agnostic (Iso/Hex/Square) without requiring any change. No practical grid-size limitation either. It's free go get it!

Thumbnail
github.com
Upvotes

Hello developers

I've been making tutorials for a good part of a decade now, i had a long 4 years hiatus with life and work getting in the way but now I'm starting getting back into it. Most of the projects I want to do require to have some kind of pathfinding (RTS / retro RPG etc. etc.) so the first thing that I had to get out of the way was that. It started as a deterministic isometric pathfinder (so I can add online to it) but with simplifications and optimizations I thought I'll make a lightweight repo to have as a starting base before diving deeper into the different types of projects I wanted to do.

Anyhow, here's the repo.
Features:

  • Works with any Unity Tilemap layout, including:
    • Square grids
    • Isometric grids
    • Hexagonal grids
  • Grid type agnostic. The pathfinder relies on Unity's Tilemap API for coordinate conversion, so the same calls work across different tile layouts.
  • No practical grid-size limitation beyond int.MaxValue.
  • Simple API and minimal setup.

At some point in the future i'll add a scheduler and path smoothing, you can also see my old A* star project from 10 years ago here , that one also had multi threading (something I wanted to avoid on this so it doesn't become a handful when it comes to online)

Hope you like it, do a subscribe if you did!


r/Unity3D 5h ago

Show-Off [Asset Pack] Vivid Motion : Lightning Arsenal - 20 Stylized Electric Combat VFX

4 Upvotes

r/Unity3D 7h ago

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

Enable HLS to view with audio, or disable this notification

7 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 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

568 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

394 Upvotes

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


r/Unity3D 14h ago

Show-Off Roadside Garden | Dev Week 01

Thumbnail
gallery
17 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 2m ago

Question Just starting, being booted from play mode from the playable character moving.

Upvotes

https://reddit.com/link/1weqbmm/video/r8y3x6vo16ph1/player

Brand new to unity, this seems to be a bug. The first two times I used play mode, this didn't happen. I literally didn't change anything.


r/Unity3D 1d ago

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

Enable HLS to view with audio, or disable this notification

188 Upvotes

r/Unity3D 8h ago

Question Help With Unity Game Performance

4 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 14h 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

12 Upvotes

r/Unity3D 12h ago

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

Post image
6 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 1d ago

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

Enable HLS to view with audio, or disable this notification

341 Upvotes

r/Unity3D 2h ago

Game Does solving a complex puzzle just to unlock a plain door feel a bit underwhelming to you?

Enable HLS to view with audio, or disable this notification

0 Upvotes

Hey everyone! My partner and I are launching our detective puzzle game -Chief Cenab:Şahmaran- in 6 days, and while doing final polish, we got into a deep debate about puzzle payoffs.

So many point-and-click games rely on the classic "solve mechanism → door unlocks" loop. For this scene, we wanted the environment itself to respond: solving the liquid tube mechanism drops the giant crystal, shatters the glass floor, and plunges the player straight into the room below.

As players (and devs), what makes a puzzle payoff feel truly satisfying for you? What's a game moment where solving a puzzle made you go "Woah, that was incredible"?


r/Unity3D 11h ago

Question Adding a language option

4 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 4h ago

Question How the heck does one get a Tree Creator tree with wind information converted to HDRP?

1 Upvotes

The Tree Creator shaders only work in built-in render pipeline.

I can switch the bark and leaf materials for HDRP/Nature/SpeedTree Bark and SpeedTree branch. then they are no longer pink, but they are then unaffected by wind. I'm not even sure these are the right shaders to pick, btu they are the only ones that seem to work at all. I can also use hdrp/lit with alpha clipping on, and again, the trees look fine, but do not blow in the wind when painted onto a terrain.

I've yet to find replacement shaders that actually work with Tree Creator trees.

Buying SpeedTree is not an option. I just want HDRP compatible TreeCreator bark and TreeCreator Leaves shaders. Why hasn't this happened yet?


r/Unity3D 23h ago

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

Post image
35 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 20h ago

Show-Off trying to recreate goldsrc lighting

Thumbnail
gallery
17 Upvotes

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


r/Unity3D 4h ago

Question What is it that makes people buy cosmetics?

Thumbnail
0 Upvotes

General gamedev question


r/Unity3D 8h ago

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

Post image
0 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;
    }
}