r/Unity3D – Telegram
r/Unity3D
266 subscribers
12.7K photos
15.6K videos
14 files
48K links
News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).
Download Telegram
Rotations are inconsistent

I'm making a game where you are a triangle and have to climb over obstacles by moving left and right (A+D), and rotating left and right (arrow keys)

sometimes the triangle will rotate over its edge with ease, and then i'll reload the game and it will start to struggle even if i didnt touch the code or rotation speed


is there anything i can do to make it work more?

https://preview.redd.it/0cdcjbtj951e1.png?width=516&format=png&auto=webp&s=3450014604125632911ea840c34d1b78817169d5



https://redd.it/1gs95nc
@r_Unity3D
2d isometric visual effects

im trying to make a game about magic and need visual effects for my spells. Im kinda new and don't know what's the best way to achieve that. Is it better to do effects (different explosions, beams stuff like that) via sprite sheets or particle systems /vfx graph and pixelizer shaders?

https://redd.it/1gsbkh2
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
I've always felt that there aren't many good games based around Christmas, so I decided to make one!

https://redd.it/1gs8x4y
@r_Unity3D
Asking for advice and direction for creating a mystery narrative game.

Hi,


I'm working on a narrative mystery game inspired by games like Ace Attorney or Danganronpa, and I'm looking for some guidance on how to structure the game in Unity. I have experience in programming but am new to Unity and still learning, so the overall game design and structure are still a mystery to me.


I think the game will need a main menu, a dialogue section for only conversations, an investigation mode (point and click), and an argument mode (conversation and mini-games like Danganronpa).


How should I decide which components to create as separate scenes? How can I move from visual novel mode to investigation mode? How can I make the inventory persistent across any mode?


Any advice or tutorials on structuring the game and deciding which components should be separate would be very helpful, because as you can see, I am confused.


Thanks in advance!

https://redd.it/1gse723
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
Working on RANDOBOUNCE, a fast-paced roguelike where you bounce uncontrollably, while shooting totally customizable weapons, bullets and perks (Reworking it after I won $100 with it on a Game Jam)
https://redd.it/1gsfvcq
@r_Unity3D
Professionals Only?

Is there a forum or place where professionals discuss Unity topics? Between unity breaking half their links to old blog posts when they moved their site, and the general trend of google getting worse, it's getting hard to find answers to obscure "unity quirks/bugs". (Dumb example... like what does "streaming" actually do on webgl? It appears to decompress the entire clip from a compressed asset bundle, behaving the same as decompress on load, but for some reason it bypasses the mute switch on iOS and plays in the background when minimizing the browser?)

At my job, I have an enterprise account that has official unity support, and we will contact them about some issues, but it takes a few days of back and forth and usually doesn't result in too much that is useful.

Is anyone aware of some secret forum/group where experienced devs can chat about stuff not filled with showoffs and beginner questions?

https://redd.it/1gsh19x
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
I’ve always dreamed of creating a paradise, and as soon as I learned Unity, I set out to make Vacation Cafe Simulator, a cozy game. Experience the charming streets of Italy, sip on Prosecco, and craft incredible culinary masterpieces in your very own café.

https://redd.it/1gsipgl
@r_Unity3D
The hand doesn't stick to the spring, help

I have troubles with making this hand stick to the bottom of the spring when i change size in "tiled" draw mode

https://preview.redd.it/zmaxhv93r81e1.png?width=2375&format=png&auto=webp&s=3803cc48df0d050b4288816e874531daa33632f9

https://preview.redd.it/dxkqzdy3r81e1.png?width=2359&format=png&auto=webp&s=541e95fa563f898afbb617105235520d3d05884e

I've tried to do it with

claw.transform.position = new Vector3(claw.transform.position.x, spring.transform.position.y, 0);

but it doesn't respond to changes.

https://redd.it/1gskmob
@r_Unity3D
Refering to a UI gameObject when prefab is instantiated

So the big sqaure in the middle with the image and the text that says \\"Tower, Stage 1, Firerate: 1, Upgrade\\" is the box i want to make appear.


So i im currently working on a small project, where its a Tower Defense game, and you earn your money by a little clicker minigame. I made the whole thing work fine, and you can buy towers and that. BUT now i want to basicly open up an upgrade menu where you can upgrade your towers. This is my current code for my tower:

using System.Collections;

using System.Collections.Generic;

using Unity.VisualScripting;

using UnityEngine;

using UnityEngine.UI;

public class CastleTower : MonoBehaviour

{

public TowerController towerController;

public SpriteRenderer SpriteRenderer;

public Sprite Castle1;

public Sprite Castle2;

public Sprite Castle3;

public Sprite Castle4;

public Sprite Castle5;

public bool Castle1Shown;

public bool Castle2Shown;

public bool Castle3Shown;

public bool Castle4Shown;

public bool Castle5Shown;

private bool isTakingDamage = false;

public int health;

private GameObject currentEnemy = null;

public Sprite currentSprite;

public Image upgradeImage;

public UpgradeMenu upgradeMenu;

public Ghost ghost;

private void Awake()

{

upgradeMenu = GameObject.Find("Upgrade Menu").GetComponent<UpgradeMenu>();

}

// Start is called before the first frame update

void Start()

{

currentSprite = Castle1;

upgradeMenu.closeMenu();

Castle1Shown = true;

Castle2Shown = false;

Castle3Shown = false;

Castle4Shown = false;

Castle5Shown = false;

}

// Update is called once per frame

void Update()

{

if (ghost.towerPlaced == true)

{

upgradeMenu = GameObject.Find("Upgrade Menu").GetComponent<UpgradeMenu>();

}

upgradeImage.sprite = currentSprite;

if (health < 0)

{

Destroy(gameObject);

}

if (Castle5Shown == true)

{

this.gameObject.GetComponent<SpriteRenderer>().sprite = Castle5;

Castle1Shown = false;

Castle2Shown = false;

Castle3Shown = false;

Castle4Shown = false;

currentSprite = Castle5;

}

if (Castle4Shown == true)

{

this.gameObject.GetComponent<SpriteRenderer>().sprite = Castle4;

Castle1Shown = false;

Castle2Shown = false;

Castle3Shown = false;

Castle5Shown = false;

currentSprite = Castle4;

}

if (Castle3Shown == true)

{

this.gameObject.GetComponent<SpriteRenderer>().sprite = Castle3;

Castle1Shown = false;

Castle2Shown = false;

Castle4Shown = false;

Castle5Shown = false;

currentSprite = Castle3;

}

if (Castle2Shown == true)

{

this.gameObject.GetComponent<SpriteRenderer>().sprite = Castle2;

Castle1Shown = false;

Castle3Shown = false;

Castle4Shown = false;

Castle5Shown = false;

currentSprite = Castle2;

}

if (Castle1Shown == true)

{

this.gameObject.GetComponent<SpriteRenderer>().sprite = Castle1;

Castle2Shown = false;

Castle3Shown = false;

Castle4Shown = false;

Castle5Shown = false;

currentSprite = Castle1;

}

}

public void OnMouseDown()

{

upgradeMenu.openMenu();

}

private void OnTriggerEnter2D(Collider2D collision)

{

if (collision.gameObject.CompareTag("Enemy") && !isTakingDamage)

{

Debug.Log("Enemy collided with: " + gameObject.name);

currentEnemy = collision.gameObject; // Store the enemy reference

StartCoroutine(TakeDamageOverTime());

}

}

private void OnTriggerExit2D(Collider2D collision)

{

if (collision.gameObject == currentEnemy)

{

StopCoroutine(TakeDamageOverTime());

isTakingDamage = false;

currentEnemy = null; // Clear the enemy reference

}

}

private IEnumerator TakeDamageOverTime()

{

isTakingDamage = true; // Mark that damage is being applied

while (currentEnemy != null) // Ensure the enemy still exists

{

health -= 1; // Reduce health by 1

yield return new WaitForSeconds(1f); // Wait for 1 second

}

isTakingDamage = false; // Stop damage when the enemy is destroyed

}

public void stage1Active()

{

Castle1Shown = true;

}

}

And this is my code for spawning in the tower:

using
System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class Ghost : MonoBehaviour

{

public GameObject CastleTower1;

// Define the placement bounds (adjust these values to fit your specific area)

public Vector2 minBounds = new Vector2(-5.5f, -4.4f); // Bottom-left corner

public Vector2 maxBounds = new Vector2(5.5f, 4.5f); // Top-right corner

public CastleTower castleTower;

public bool towerPlaced;

private void Start()

{

towerPlaced = false;

}

// Update is called once per frame

void Update()

{

// Get the mouse position in world space

Vector3 mousPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);

mousPos.z = 0;

// Clamp the position to stay within the defined bounds

mousPos.x = Mathf.Clamp(mousPos.x, minBounds.x, maxBounds.x);

mousPos.y = Mathf.Clamp(mousPos.y, minBounds.y, maxBounds.y);

// Update the ghost's position

transform.position = mousPos;

// Place the tower and destroy the ghost on left mouse click

if (Input.GetMouseButtonDown(0))

{

// Check if the position is within the allowed area (optional, as clamping already handles this)

if (IsWithinBounds(mousPos))

{

Instantiate(CastleTower1, transform.position, Quaternion.identity);

Destroy(gameObject);

towerPlaced = true;

}

}

}

bool IsWithinBounds(Vector3 position)

{

return position.x >= minBounds.x && position.x <= maxBounds.x &&

position.y >= minBounds.y && position.y <= maxBounds.y;

}

}It is probably really messy, but this is one of my first games, so bare over with me. When the tower is in the scene as i start, it ofc works fine, and the refence works too. But when i go ahead and instantiate one, the refence dosent go through. I've thought about it alot, but can't seem to figure out how to do it.

Does anyone know how to do this?

https://redd.it/1gslz4p
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
It took us three years, but now everything is destructible in our upcoming game.
https://redd.it/1gsndkz
@r_Unity3D
Looking for advice on where to start to create a "level maker" feature where players can make, export, and share 2D maps

I want to make a game where people can make and share levels, but I want the editor to be very automated and controlled so that players don't have to worry about things like explicitly setting lighting effects, collisions, interactive objects, etc, that they can just grab and drop tiles or objects into the editor and logic handles how the game world effects it.

https://redd.it/1gsovpg
@r_Unity3D
I hate this part. (Camera explanation and mini rant in the comments.)
https://redd.it/1gsqxg3
@r_Unity3D