156
News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).
I made two types of textures for one modular asset - Hand-painted in 3DCoat and Real Watercolor on paper.
https://redd.it/1sn2ah4
@r_Unity3D
C# dev looking for a Unity mentor / codingbuddy
/r/unity/comments/1sn3te7/c_dev_looking_for_a_unity_mentor_codingbuddy/
https://redd.it/1sn3u0d
@r_Unity3D
shaun the sheep game please help!
Recently for a school project I have attempted to create a Shaun the Sheep game based on: https://www.gameflare.com/online-game/home-sheep-home/ but it is impossible :( Whenever I try to add text using the TextMeshPro it always tells me that there is an error because I haven't downloaded the TextMesh Essentials and the Examples pack even thought I already have.
I cannot see the text whenever I try to open it and I have changed all the settings like font size, colour and placement but it is still invisible. In the font section, it says its blank but when I click to change it, nothing comes up. I have checked and all the TMP files are in my assets folder but it still doesn't work. I have restarted and updated Unity, I have Unity 6, and it won't work even when I reopen and close it again.
It looks like this whenever I try to add anything
Is there any way to fix this?
Thank you!
https://redd.it/1sn0cbm
@r_Unity3D
How large is your Behaviour Tree?
https://redd.it/1smv0v2
@r_Unity3D
How large is your Behaviour Tree?
https://redd.it/1smv188
@r_Unity3D
We're validating a tool idea before building it — 4 min survey for game devs and 3D artists
I'm Hemanth, an Unreal generalist from India. My friend and I are thinking of building a tool that helps game studios, indie devs, and freelancers catch 3D asset issues before they break in-engine — saving hours of back and forth.
Before we write a single line of code, we want to hear from real artists and devs first. No pitch, no product links — just 14 honest questions about your current workflow.
Takes 4 minutes 👇
https://forms.gle/oPFKtY2yTZSzLFeGA
Really appreciate any responses. Happy to share the results with anyone interested once we have enough data!
https://redd.it/1smssoc
@r_Unity3D
RogueMuncher DevLog - Speedmuncher character breakdown
https://www.youtube.com/watch?v=iNSSm7Sut9g
https://redd.it/1smq779
@r_Unity3D
Help me, internet. I need advice on creating Physics2D-enabled cosmetics
Hey everyone, I've got a problem I've been working on for too long and I would love a fresh set of eyes if anyone has any ideas.
In my game, players control a car. I'd like to set up a cosmetics system where players can equip cosmetics that react appropriately with physics (say, a wobbly antenna, or a hat that bounces up and down), but without the mass or drag of the cosmetic affecting the car’s physics (I.E. cosmetics shouldn't affect gameplay).
So if you take the wobbly antenna as an example, the basic setup currently looks like this:
* **Car:** A dynamic Rigidbody2D. It's sometimes moves via AddForce, and sometimes via MovePosition, depending on the context (cutscenes and stuff).
* **CosmeticBase:** A kinematic Rigidbody2D that serves as an anchor point for the rest of the cosmetic.
* **Antenna:** The various dynamic Rigidbody2Ds that make up the actual cosmetic. For now, just image that it's a single dyanmic GameObject attached to the CosmeticBase via a SpringJoint2D.
So in theory, the CosmeticBase follows the Car, and the Antenna is jointed to the CosmeticBase - so the Antenna follows the Car with realistic physics, without itself impacting the physics of the Car.
I cannot for the life of me get this to actually work, though. Here's what I've tried:
**Attempt #1: Simple Parenting**
Having the CosmeticBase be a child of the Car GameObject makes the CosmeticBase track the Car beautifully, but because it's now being moved via transform, the Antenna/Base Joint doesn't behave properly. The physics looks terrible and the Antenna GameObjects are frequently disconnected from and trying to "catch up" to the CosmeticBase.
**Attempt #2: Joint Between Car and Base**
The CosmeticBase now tracks properly and the Antenna/Base Joint works as intended, but this obviously isn't viable because then the mass, drag, etc. of the Antenna are transferred into the Car's physics.
**Attempt #3: Move Position on the CosmeticBase**
After removing the Base/Car Joint and unparenting the Base from the Car, I tried this. In FixedUpdate, I added this onto the CosmeticBase:
BaseKinematicRb2D.position = CarRb2D.position + offset;
BaseKinematicRb2D.rotation = CarRb2D.rotation;
This ALMOST works, but not quite. The Antenna/Base Joint works properly, and the CosmeticBase TRIES to match the Car's position, but the CosmeticBase visually lags behind the Car pretty clearly - I assume because it's matching the Car position from the previous "tick", due to how the Physics system works. It's being set to where the Car WAS, not where it's GOING. I tried messing with the Interpolation settings of all the Rigidbody2D's involved, but nothing changed the end result.
**Attempt #4: Same as above, but with predictive velocity**
The closest I've gotten so far is this:
Vector2 predictedPos = (Vector2)CarRb2D.transform.TransformPoint(positionOffset) + CarRb2D.velocity * Time.fixedDeltaTime;
float predictedRot = CarRb2D.rotation + CarRb2D.angularVelocity * Time.fixedDeltaTime + rotationalOffset;
BaseKinematicRb2D.MovePosition(predictedPos);
BaseKinematicRb2D.MoveRotation(predictedRot);
Where the CosmeticBase "guesses" where it's supposed to be on this Physics step based on the position of the Car and its current velocity.
It's... okay. It sort of works when the Car is being moved by AddForce, but obviously for sudden accelerations or decelerations there can be some noticeable shifting. I don't love it. Obviously it doesn't work at all for MovePosition, but it wouldn't be too hard to add that in too.
The thing is, this isn't exactly a super unique thing that I'm designing, so I feel like there must be some industry standard solution here that I'm missing. I can't imagine Rocket League is using predictive velocities. Anyone have any suggestions?
To summarize, the goal here is:
I would like Dynamic, Physics2D-enabled cosmetics to be able to follow a car, realistically reacting to its movements. However, the physics
Released our Unity Pinball game where the world is 3D, but the all the physics is in 2D.
https://redd.it/1sminxv
@r_Unity3D
We’ve implemented a mechanic for creating robots that help the player work on an automated farm
https://redd.it/1smhkt3
@r_Unity3D
I prototyped a one-handed Star Fox-style mobile game! And it somehow works way better than I expected! Gyro = aim, tap = shoot, swipe = move
https://redd.it/1smdscu
@r_Unity3D
Making puzzle for my 2d horror game
https://redd.it/1sji1ra
@r_Unity3D
Can you help me to add the roll/dash into my code for my platform?
i'm not a programmer, and i do all with tutorial on youtube, but i want to make my own game, could you please help me? how can i do a dodge, roll/dash only when the player is on the ground? i'd like it to have i-frames and that he can bypass the enemy (the enemy have the layer enemy if it can be helpful)
now i'll send the code here so you can see it, tell me if i have to be more specific🫡
using UnityEngine;
using UnityEngine.SceneManagement;
public class PlayerMovement : MonoBehaviour
{
[Header("Movement")\]
[SerializeField\] private float speed = 5f;
[SerializeField\] private float jumpForce = 12f;
[Header("Collision")\]
[SerializeField\] private LayerMask groundLayer;
[SerializeField\] private float wallCheckDistance = 0.5f;
[Header("Attack")\]
[SerializeField\] private float attackCooldown = 0.5f;
private float attackTimer;
public GameObject attackPoint;
public float radius;
public LayerMask enemies;
public float damage;
[Header("Ledge info")\]
[SerializeField\] private Vector2 offset1;
[SerializeField\] private Vector2 offset2;
// Componenti
private Rigidbody2D body;
private Animator anim;
private CapsuleCollider2D capsuleCollider;
// Movimento
private float horizontalInput;
private bool isWallDetected;
private bool canWallSlide;
private bool isWallSliding;
// Ledge
[HideInInspector\] public bool ledgeDetected;
private bool canGrabLedge = true;
private bool canClimb;
private Vector2 climbBegunPosition;
private Vector2 climbOverPosition;
// Gravità originale
private float originalGravityScale;
// Singleton per evitare duplicati
public static PlayerMovement Instance { get; private set; }
private void Awake()
{
// Se esiste già un player (da una scena precedente), distruggi questo duplicato
if (Instance != null && Instance != this)
{
Destroy(gameObject);
return;
}
Instance = this;
DontDestroyOnLoad(gameObject); // Il player sopravvive al cambio scena
body = GetComponent<Rigidbody2D>();
anim = GetComponent<Animator>();
capsuleCollider = GetComponent<CapsuleCollider2D>();
originalGravityScale = body.gravityScale;
// Ascolta l'evento di caricamento scena per posizionare il player
SceneManager.sceneLoaded += OnSceneLoaded;
}
private void OnDestroy()
{
SceneManager.sceneLoaded -= OnSceneLoaded;
}
// Chiamato automaticamente ogni volta che una scena finisce di caricare
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (PlayerSpawnManager.Instance != null && PlayerSpawnManager.Instance.hasCustomSpawn)
{
transform.position = PlayerSpawnManager.Instance.spawnPosition;
PlayerSpawnManager.Instance.Clear();
}
}
private void Update()
{
// --- INPUT ---
horizontalInput = Input.GetAxis("Horizontal");
// --- FLIP PLAYER ---
FlipController();
// --- CONTROLLO MURO ---
CollisionCheck();
// --- MOVIMENTO E SALTO ---
if (!canClimb)
{
if (isWallSliding)
body.linearVelocity = new Vector2(0, body.linearVelocity.y);
else
body.linearVelocity = new Vector2(horizontalInput * speed, body.linearVelocity.y);
if (Input.GetKeyDown(KeyCode.Z))
Jump();
}
// --- LEDGE GRAB ---
CheckForLedge();
// --- ANIMAZIONI ---
HandleAnimations();
// --- ATTACCO ---
attackTimer -= Time.deltaTime;
if (Input.GetKeyDown(KeyCode.X) && attackTimer <= 0)
{
anim.SetBool("isAttacking", true);
attackTimer = attackCooldown;
}
}
private void FixedUpdate()
{
// --- WALL SLIDE ---
if (isWallDetected && canWallSlide)
{
isWallSliding = true;
body.linearVelocity = new Vector2(
body.linearVelocity.x,
Mathf.Clamp(body.linearVelocity.y, -2f, float.MaxValue)
);
}
else
{
isWallSliding = false;
}
// --- LEDGE CLIMB ---
if (canClimb)
{
body.gravityScale = 0;
body.linearVelocity = Vector2.zero;
body.MovePosition(Vector2.Lerp(body.position, climbBegunPosition, Time.fixedDeltaTime * 8f));
if (Vector2.Distance(body.position, climbBegunPosition) < 0.05f)
{
LedgeClimbOver();
}
}
else
{
body.gravityScale = originalGravityScale;
}
}
// -----------------------
// FUNZIONI
Cooking instant noodles like a bum in my VR anime narrative game
https://redd.it/1sjbrx0
@r_Unity3D
Burnt out making a mobile game
https://redd.it/1sj7w9s
@r_Unity3D
I'm building a massive RPG Item Pack for the itch community. I'll be releasing new free items every day!
https://redd.it/1sn4j8f
@r_Unity3D
Should I keep this in the game or remove it…
https://redd.it/1smzq1m
@r_Unity3D
We added rolling to our blocky adventure RPG
https://redd.it/1smyrzc
@r_Unity3D
Selling source code of my puzzle game with infinite level
yup, the title says the most. the game is a puzzle game made in unity 2D. The game had good engagement and took me over 1 year to make this. currently selling the source code for 25$ .
Google admob and Google analytics are integrated
link :- https://play.google.com/store/apps/details?id=com.LRASTUDIO.MAZZER
https://redd.it/1smxekv
@r_Unity3D
我做了一個2D遊戲
我是一個高三生,透過自學unity跟c#做了一個小遊戲,可以幫我試玩看看嗎?可以的話希望也填一下表單🥹🥹🥹
google表單: https://forms.gle/UGvTdg55Hg3bw3Vp7
遊戲下載連結 https://drive.google.com/drive/folders/1KYKFEJ7\_r2zBKpgVbf4QJQiA11Bpc6Km?usp=sharing
https://redd.it/1smpq19
@r_Unity3D
Trouble changing code between unity versions
https://redd.it/1smri1z
@r_Unity3D
behaviour of the car should be completely unaffected by the physics of the cosmetics.
Anyone run into this before? Any brilliant ideas?
https://redd.it/1smpwlz
@r_Unity3D
Encuesta para Videojuego Indie
/r/videojuegos/comments/1smohzf/encuesta_para_videojuego_indie/
https://redd.it/1smoj3d
@r_Unity3D
Foldout state keeps resetting (UI Toolkit)
https://redd.it/1smiw9p
@r_Unity3D
[Free Asset] Save your Runtime Changes instantly with this tool "Play Mode Changes Saver (Runtime-Saver)"
Just wanted to share a small utility I released. It’s a "Runtime Saver" that keeps your component tweaks alive after you exit the Play Mode.
* **Simple to use**
* **Saves time during balancing**
* **100% Free**
Search for **"Play Mode Changes Saver (Runtime-Saver)"**
Feedback is always welcome!
https://redd.it/1smch5w
@r_Unity3D
Swing mechanic - What should I do with it?
https://redd.it/1sjio3q
@r_Unity3D
MOVIMENTO
// -----------------------
private void FlipController()
{
if (horizontalInput > 0.01f)
transform.localScale = new Vector3(3, 3, 1);
else if (horizontalInput < -0.01f)
transform.localScale = new Vector3(-3, 3, 1);
}
private void Jump()
{
if (isGrounded())
{
body.linearVelocity = new Vector2(body.linearVelocity.x, jumpForce);
anim.SetTrigger("jump");
}
}
private void CollisionCheck()
{
Vector2 direction = new Vector2(Mathf.Sign(transform.localScale.x), 0f);
RaycastHit2D hit = Physics2D.BoxCast(
capsuleCollider.bounds.center,
capsuleCollider.bounds.size,
0f,
direction,
wallCheckDistance,
groundLayer
);
isWallDetected = hit.collider != null;
canWallSlide = isWallDetected && !isGrounded();
}
// -----------------------
// LEDGE CLIMB
// -----------------------
private void CheckForLedge()
{
if (ledgeDetected && canGrabLedge && !canClimb)
{
canGrabLedge = false;
Vector2 ledgePosition = GetComponentInChildren<LedgeDetection>().transform.position;
float direction = Mathf.Sign(transform.localScale.x);
Vector2 adjustedOffset1 = new Vector2(offset1.x * direction, offset1.y);
Vector2 adjustedOffset2 = new Vector2(offset2.x * direction, offset2.y);
climbBegunPosition = ledgePosition + adjustedOffset1;
climbOverPosition = ledgePosition + adjustedOffset2;
canClimb = true;
}
}
private void LedgeClimbOver()
{
canClimb = false;
body.gravityScale = originalGravityScale;
transform.position = climbOverPosition;
Invoke("AllowLedgeGrab", 0.1f);
}
private void AllowLedgeGrab() => canGrabLedge = true;
// -----------------------
// ANIMAZIONI
// -----------------------
private void HandleAnimations()
{
if (isWallSliding)
{
anim.SetBool("Run", false);
anim.SetBool("fall", false);
anim.SetBool("isWallSliding", true);
}
else
{
anim.SetBool("Run", horizontalInput != 0);
anim.SetBool("grounded", isGrounded());
anim.SetBool("fall", body.linearVelocity.y < -0.1f && !isGrounded());
anim.SetBool("isWallSliding", false);
anim.SetBool("canClimb", canClimb);
}
if (Input.GetKeyDown(KeyCode.X))
{
anim.SetBool("isAttacking", true);
}
}
// -----------------------
// ATTACCO
// -----------------------
public void Attack()
{
Collider2D[\] enemy = Physics2D.OverlapCircleAll(attackPoint.transform.position, radius, enemies);
foreach (Collider2D enemyGameObject in enemy)
{
Debug.Log("Hit Enemy");
enemyGameObject.GetComponent<EnemyHealth>().health -= damage;
}
}
public void EndAttack()
{
anim.SetBool("isAttacking", false);
}
// -----------------------
// UTILITY
// -----------------------
private bool isGrounded()
{
RaycastHit2D raycastHit = Physics2D.BoxCast(
capsuleCollider.bounds.center,
capsuleCollider.bounds.size,
0f,
Vector2.down,
0.1f,
groundLayer
);
return raycastHit.collider != null;
}
private void OnDrawGizmos()
{
if (capsuleCollider == null) return;
Gizmos.color = Color.red;
Vector3 direction3 = Application.isPlaying
? new Vector3(Mathf.Sign(transform.localScale.x), 0, 0)
: Vector3.right;
Gizmos.DrawLine(capsuleCollider.bounds.center, capsuleCollider.bounds.center + direction3 * wallCheckDistance);
if (attackPoint != null)
{
Gizmos.DrawWireSphere(attackPoint.transform.position, radius);
}
}
}
thank you in advance!❤️
https://redd.it/1sjefji
@r_Unity3D
2D Character Controller (no Rigidbody2D)?
Let's face it: collision checking is hard, and I'm glad Unity has a solution for 3D games with the Character Controller, but there is nothing like that for 2D as far as I know.
I', doing a Top-Down game and I don't want to deal with Rigidbody's physics, so I tried to do my own collide and slide with poor results (I'm not a professional so the complex math it requires is beyond me). I could use the Character Controller in 2D too, but it only detects 3D colliders (of course).
I'm pretty sure I could find a solution in the Asset Store, or I could bash my head over and over to get the collide and slide method working, but is there really no way to have the collision checking of the Rigidbody2D without having to deal with physics?
https://redd.it/1sjemyg
@r_Unity3D
Mod text in game.
/r/Unity3D/comments/1sjcgav/mod_text_in_game/
https://redd.it/1sjcgvj
@r_Unity3D
Made a new interactive main menu for Koloboke game
https://redd.it/1sj3l4c
@r_Unity3D