r_unity3d | Unsorted

Telegram-канал r_unity3d - r/Unity3D

156

News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).

Subscribe to a channel

r/Unity3D

After asking someone to make a system where they turn toward you when you talk to them…

https://redd.it/1tjfpoj
@r_Unity3D

Читать полностью…

r/Unity3D

Rosso Games - Devlog #2 | AP, Pathfinding & Item Collection

https://redd.it/1tje9wi
@r_Unity3D

Читать полностью…

r/Unity3D

Solo dev offering quick Unity bug fixes & scripting to fund my game!

https://redd.it/1tjcobk
@r_Unity3D

Читать полностью…

r/Unity3D

PSA: Be careful if you add grappling hooks to your game, my players found out that they can score goals from across the map by hooking onto projectiles lol

https://redd.it/1tj0obl
@r_Unity3D

Читать полностью…

r/Unity3D

Just make it exist first ...

https://redd.it/1tipyh2
@r_Unity3D

Читать полностью…

r/Unity3D

What do you think about atmosphere? Preparing for night fight!
https://redd.it/1tit8k8
@r_Unity3D

Читать полностью…

r/Unity3D

Animator sent me this Evil animation hit. Is it?

https://redd.it/1tin8l4
@r_Unity3D

Читать полностью…

r/Unity3D

I saw a painterly shader on TikTok and tried to recreate it in Unity

https://redd.it/1tim92d
@r_Unity3D

Читать полностью…

r/Unity3D

I’m working on MMA manager sim
https://www.reddit.com/gallery/1tikq11

https://redd.it/1tikv1d
@r_Unity3D

Читать полностью…

r/Unity3D

City builder save systems are absolute monsters

I finally finished the save system for my city builder Venusville.

Took about 3 months.

I already had a save/load library from my first game, so I thought I was in a good place. Objects had IDs, ScriptableObject states could serialize fine, and I already had a clean marshal/unmarshal pipeline for state data.

Turns out city builders are a completely different monster.

The real problem wasn’t saving data. It was restoring *everything* correctly:

* prefabs
* dependencies
* object relations
* AI state
* third-party libraries that absolutely did not want to cooperate

One of the biggest changes was simplifying the start-up flow. Loading a save and starting a new game now both happen outside the play scene, so the play scene only has a single responsibility: restore from Scriptable Object state data.

Previously I relied heavily on prefab Start() functions and editor-assigned setup data for new games, which worked fine until save/load entered the picture. Dependencies became inconsistent really fast.

I ended up introducing 5 restoration phases:

1. Restore core objects (entities like people, buildings / interiors / resources)
2. Restore dependencies (between components and child components)
3. Restore relationships (between entities like people carry a resource)
4. Restore behaviour trees phase 1
5. Restore behaviour trees phase 2

The behaviour tree part was especially painful.

I use which is a great library overall, but it does some really questionable things internally. For example, it would wipe shared variables referencing GameObjects after I had already restored them. That kind of thing forced me into a bunch of ugly workaround systems where I had to cache and restore data around enabling behaviour trees.

Then came the hidden bugs.

I had a couple cases where data existed in two places instead of having one source of truth. Example: both issuers and people stored copies of the same contract data (like production in the Atmos Factory). Everything looked fine initially, but loaded games slowly started drifting into broken states.

Those were the worst bugs because they were slow-burn problems. Side effects would appear 5-20 minutes later and then spread through the simulation like a virus.

Anyway.

I can save and load a city builder now.

https://redd.it/1tie1w5
@r_Unity3D

Читать полностью…

r/Unity3D

why does my player fly upward when i dash upward even though i have a velocity in the opposite direction?

using UnityEngine;


public class PlayerControler : MonoBehaviour
{
    [SerializeField] private Rigidbody2D RB;
    public float speed = 5f;


    //variables for jump
    public int jumpamound = 2;
    public int jumpamoundmax = 2;
    public float jumpforce = 7f;
    bool jumpPressed = false;


    //variables for coyote time
    public float MaxCoyoteTime = 0.5f;
    float CoyoteTime = 0f;
    bool CoyoteTimeBool = false;
    public bool CanCoyoteTime = false;


    //variables for dash
    public float dashforce = 10f;
    public bool dashPressed = false;
    public float dashTime = 0.2f;
    public float dashTimeLeft = 0;



    void Start()
    {
        RB = GetComponent<Rigidbody2D>();
        CoyoteTime = MaxCoyoteTime;
    }


    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            jumpPressed = true;
        }
        if (Input.GetKeyDown(KeyCode.LeftShift))
        {
            dashPressed = true;
            dashTimeLeft = dashTime;
        }
    }


    void FixedUpdate()
    {
        JumpHandeling();
        CoyoteTimeHandeling();


        if (!dashPressed)
        {
            MovementHandeling();
        }
        else
        {
            DashHandeling();
        }
    }


    void DashHandeling()
    {
        float movehorizontal = Input.GetAxis("Horizontal");
        float movevertical = Input.GetAxis("Vertical");


        if (dashPressed)
        {
            dashTimeLeft -= Time.deltaTime;
            if (dashTimeLeft > 0)
            {
                Vector2 dashdir = new Vector2(movehorizontal, movevertical);
                dashdir.Normalize();


                if (dashdir == Vector2.zero)
                {
                    dashdir = new Vector2(transform.localScale.x, 0);
                }
                if (dashdir.y != 0)
                {
                    if (dashdir.y > 0)
                    {
                        RB.linearVelocity = -dashdir * dashforce;
                    } else
                    {
                        RB.linearVelocity = dashdir * dashforce ;
                    }
                }


                RB.linearVelocity = dashdir * dashforce;


                RB.gravityScale = 0;
            }
            else if (dashTimeLeft <= 0)
            {
                dashPressed = false;
                RB.gravityScale = 1f;
            }
        }
    }


    void MovementHandeling()
    {
        float movehorizontal = Input.GetAxis("Horizontal");
        RB.linearVelocity = new Vector2(movehorizontal * speed * Time.deltaTime, RB.linearVelocity.y);
    }


    void JumpHandeling()
    {
        if (jumpPressed && (jumpamound > 0 || CanCoyoteTime))
        {
            Vector2 velocity = RB.linearVelocity;
            velocity.y = 0f;
            RB.linearVelocity = velocity;


            RB.AddForce(new Vector2(0, jumpforce), ForceMode2D.Impulse);
            jumpPressed = false;
            jumpamound--;


            CanCoyoteTime = false;
            CoyoteTime = 0;
        }
    }


    void CoyoteTimeHandeling()
    {
        if (CoyoteTimeBool)
        {
            if (CoyoteTime > 0)
            {
                CoyoteTime -= Time.deltaTime;
                CanCoyoteTime = true;
            }
            else if (CoyoteTime <= 0)
            {
                CanCoyoteTime = false;
             

Читать полностью…

r/Unity3D

How would you use editable vector shapes as particle emitters in Unity?
/r/Unity2D/comments/1tiejuu/how_would_you_use_editable_vector_shapes_as/

https://redd.it/1tiekbh
@r_Unity3D

Читать полностью…

r/Unity3D

How I developed the artstyle for my main character

https://redd.it/1ti2ptb
@r_Unity3D

Читать полностью…

r/Unity3D

Built an inventory system that auto-adjusts hand placement for any item you pick up

https://redd.it/1thx3j5
@r_Unity3D

Читать полностью…

r/Unity3D

Making a 3D platformer heavily inspired by Spyro + Crash Bandicoot. What do you guys think?

https://redd.it/1thnel0
@r_Unity3D

Читать полностью…

r/Unity3D

Need Feedback on my (Early Game) Combat

https://redd.it/1tjgefx
@r_Unity3D

Читать полностью…

r/Unity3D

In between dangerous expeditions, you also have to manage your base and your survivors. Plant food to secure a reliable income or starve to death.

https://redd.it/1tjdoso
@r_Unity3D

Читать полностью…

r/Unity3D

oh god
https://imgur.com/a/eUtEicU

https://redd.it/1tj4tn1
@r_Unity3D

Читать полностью…

r/Unity3D

Instead of "capsule shadows" we did "capsule caustics" for our music visualizer's main menu

https://redd.it/1tiyuxb
@r_Unity3D

Читать полностью…

r/Unity3D

How would you use editable vector shapes as particle emitters in Unity?

https://redd.it/1tijo68
@r_Unity3D

Читать полностью…

r/Unity3D

Overcooked and Osu is a good mix?

https://redd.it/1tiqlgq
@r_Unity3D

Читать полностью…

r/Unity3D

I built a Real-Time Surface-Pressure Buoyancy simulation with Adaptive Curved Clipping for coarse meshes using a C++ Native Plugin for performance. (Open Source + Full Code)

https://redd.it/1tinzs7
@r_Unity3D

Читать полностью…

r/Unity3D

Free Card Templates
https://www.reddit.com/gallery/1til8j9

https://redd.it/1tilavj
@r_Unity3D

Читать полностью…

r/Unity3D

Free Textures Stylized Bricks & Plaster

https://redd.it/1tiiior
@r_Unity3D

Читать полностью…

r/Unity3D

  jumpamound = 0;
            }
        }
        else if (!CoyoteTimeBool)
        {
            jumpamound = 1;
            CanCoyoteTime = true;
        }
    }


    void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.CompareTag("ground"))
        {
           
Debug.Log("ground");
            CoyoteTimeBool = true;
            jumpamound = jumpamoundmax;
            CoyoteTime = MaxCoyoteTime;
            CanCoyoteTime = true;
        }
    }


    void OnCollisionExit2D (Collision2Dncollision)
    {
        if (collision.gameObject.CompareTag("ground"))
        {
            CoyoteTimeBool = true;
            CoyoteTime = MaxCoyoteTime;
        }
    }


    void OnCollisionStay2D(Collision2D collision)
    {
        if (collision.gameObject.CompareTag("ground"))
        {
            jumpamound = jumpamoundmax;
        }
    }
}

https://redd.it/1tignve
@r_Unity3D

Читать полностью…

r/Unity3D

How would you use editable vector shapes as particle emitters in Unity?

I’ve been experimenting with this as part of a small Unity editor tool I’m building.

The idea is to draw or animate editable vector shapes directly in the Scene View, then use the shape edges or vertices to drive different Particle System emission patterns.

The GIF shows two shape-driven particle systems: one emitting from vertices, and one emitting from the edge.

I’m curious where this kind of workflow would be most useful - UI effects, stylized 2D VFX, magic effects, gameplay zones, map markers, or editor/debug visuals?

https://i.redd.it/kxb5x07hx82h1.gif



https://redd.it/1tiejuu
@r_Unity3D

Читать полностью…

r/Unity3D

I built a Unity asset indexer website because I kept forgetting what assets I own
/r/Unity3D/comments/1ticyl3/i_built_a_unity_asset_indexer_website_because_i/

https://redd.it/1ticz8n
@r_Unity3D

Читать полностью…

r/Unity3D

Broke indie developpers, what are the tools and apps that helped you the most with your games?

I've been looking for good and free tools but failed so some recommendations would be great

https://redd.it/1ti02wd
@r_Unity3D

Читать полностью…

r/Unity3D

im working on a puzzle game all about weird magical tools, the first is this ability to swap two objects with eachother

https://redd.it/1thps5l
@r_Unity3D

Читать полностью…

r/Unity3D

Oh my godrays!

https://redd.it/1thj7y8
@r_Unity3D

Читать полностью…
Subscribe to a channel