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

Unity 2D Tilemap Can Actually Be Fully 3D

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

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

r/Unity3D

if (CurrentLookDirection == LookDirection.Right)
{
playerSprite.flipX = false;
}
else if (CurrentLookDirection == LookDirection.Left)
{
playerSprite.flipX = true;
}
}

private void OnFire()
{
Debug.Log("Fire");
}
}

I also tried this camera script I found online, which didn't seem to help with the crosshair jitter:

[https://gist.github.com/venediklee/1437f3c908cc135be10c4ddb2f23bec9](https://gist.github.com/venediklee/1437f3c908cc135be10c4ddb2f23bec9)

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

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

r/Unity3D

Sprite jitter when using pixel perfect camera and camera movement

[The video looks a bit weird because of gif conversion](https://i.redd.it/zbnq5cx87yke1.gif)

Hi, I am trying to make a pixel art game and I really like the look of the pixel perfect camera where everything is on the pixel grid. However, I am having this issue where moving sprites will jitter as long as the camera is moving. I am using Cinemachine right now, but I have tried a custom camera script, and while it helps with the player's jittering, other sprites still jitter.

I have tried a lot of solutions, including snapping both the camera and the sprite to the pixel grid, but nothing seems to get rid of it. Also have tried disabling dampening, etc. but it seems to happen with basically any camera movement. Would really appreciate any advice or solutions. I am thinking I might have to use something other than the pixel perfect camera as it does not appear to be working well in Unity.


Here is the relevant code:

Input manager:

public class InputManager : MonoBehaviour
{
public static Vector2 Movement;
public static Vector2 Look;

private PlayerInput playerInput;

private InputAction moveAction;
private InputAction lookAction;

private GameObject aimTarget;

private Vector2 lastLookOffset;

[SerializeField] private float aimDistance = 2f;
[SerializeField] private float aimSmoothing = 10f;
[SerializeField] private float gamepadDeadzone = 0.5f;

void Awake()
{
playerInput = GetComponent<PlayerInput>();
moveAction = playerInput.actions["Move"];
lookAction = playerInput.actions["Look"];

aimTarget = GameObject.Find("AimTarget");
if (aimTarget == null)
{
aimTarget = new GameObject("AimTarget");
aimTarget.transform.position = Vector3.zero; // Default position
}
}


void Update()
{
Movement = moveAction.ReadValue<Vector2>();
Look = ProcessLookInput();

//aimTarget.transform.position = new Vector3(Mathf.Round(Look.x * 16) / 16, Mathf.Round(Look.y * 16) / 16, aimTarget.transform.position.z);
aimTarget.transform.position = new Vector3(Look.x, Look.y, aimTarget.transform.position.z);
}


private Vector2 ProcessLookInput()
{
Vector2 lookInput = lookAction.ReadValue<Vector2>();

string controlScheme = playerInput.currentControlScheme;

Vector2 playerPosition = transform.position;

float distanceToPlayer = Vector2.Distance(playerPosition, Look);

if (controlScheme == "KeyboardMouse")
{
//Vector3 mousePosition = Mouse.current.position.ReadValue();
return Camera.main.ScreenToWorldPoint(lookInput);
}
else if (controlScheme == "Gamepad" && lookInput.magnitude > gamepadDeadzone)
{
Vector2 aimOffset = new Vector2(lookInput.x, lookInput.y) * aimDistance;
Vector2 targetLook = playerPosition + aimOffset;
lastLookOffset = lookInput.normalized;
return Vector2.Lerp(Look, targetLook, Time.deltaTime * aimSmoothing);
}
else if (controlScheme == "Gamepad")
{
if (lastLookOffset == Vector2.zero)
{
lastLookOffset = new Vector2(1, 0);
}
return Vector2.Lerp(Look, (playerPosition + (lastLookOffset * aimDistance * 0.5f)), Time.deltaTime * aimSmoothing);
}

return Look;
}

}



Player controller:

public class PlayerController : MonoBehaviour
{
[Header("Movement")]
[SerializeField] private float moveSpeed = 5f;
[SerializeField] private float smoothTime = 0.1f;

[Header("References")]

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

r/Unity3D

I tried flip mechanism for rally car, just testing to see if its fun.

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

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

r/Unity3D

Where u get sprites

I'm looking for the sprites that would be used for my game. Tell me the way to get sprites except for itch io or asset store in unity.

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

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

r/Unity3D

Unity just laid off the entire staff for their Behavior package...

Source (forums): https://discussions.unity.com/t/an-update-on-behavior/1598451

For those that don't know, Behavior package is a recent package announced months back as a visual tool for authoring behaviors used to control non-player characters (NPCs) or objects. Essentially a behavior tree (but it goes beyond that). You might think of Muse AI but they are completely separate packages.

Anyone find this news incredibly disappointing? The package was for once actually very good and it had a use case for a lot of games. The team involved in this has also been very transparent in communications over the updates and has been very active in the forums to answer questions, even adding features that were requested.

What are the executives even thinking here? Killing off a package and its team before it could fully take off. We finally had something good here...

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

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

r/Unity3D

After tons of sketches, we finally nailed down our rock enemies! Eric, our designer/animator, designed a whole family of stone monsters—neutral, distinct, and tough enough that you won’t feel too bad smashing them😁
https://redd.it/1im847u
@r_Unity3D

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

r/Unity3D

How to add dynamic shadows like Guacamelee 2?
https://redd.it/1imeau9
@r_Unity3D

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

r/Unity3D

Our Wolf Dragon in 2019 concept art vs 2025 game development in Unity!
https://redd.it/1imbyax
@r_Unity3D

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

r/Unity3D

My Demo Just Hit 100 Reviews, and They're ALL Positive! I'm Over the Moon!
https://redd.it/1im7g44
@r_Unity3D

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

r/Unity3D

For festival applications (INDIE Live Expo), a 15-second game trailer is required. That's short, of course. I tried to put one together. Does it look okay?

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

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

r/Unity3D

What do you think of this main menu :)
https://redd.it/1im37u8
@r_Unity3D

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

r/Unity3D

Unity feels more intuitive compared to Unreal?

Hey eveyone, just a dilemma here!

Why does Unity feel more faster and intuitive compared to Unreal it comes to mechanics and concepts, given that like coding especially in unreal c++ and Unity c#. For example, in Unity you would just do one mechanic and add that script to the gameobject to perform that mechanic, whereas in unreal you need to do 2/3 more steps to have that mechanic.

Now from a technical standpoint both have their plus and minus especially for a solo dev with a full time job in a completely different sphere.

Having said that, i may end up moving to Unity for solo game dev while having a full time job.

But have you encountered the same scenario as well?

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

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

r/Unity3D

Currently making my dream game!

https://youtu.be/-35gk1aiejA

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

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

r/Unity3D

Dynamic Shadows Isometric 2D

I was trying to add some dynamic shadows and light to my 2D. I did find a solution but it's not really good and it's hard adjust the position of the shadows on account of the differents pivot of the sprites. Also, this method doesn't seem to work for sprites that are more than 1 tile. The system is basically just the instatiated GO of the tile that rotates according to the light position in the scene. Does anyone have a better idea on how I could do this?

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

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

r/Unity3D

Improved the backgrounds and finally added a proper arcade mode to our fighting game Punch Planet, here's what it's looking like now.
https://streamable.com/4q7nwx

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

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

r/Unity3D

[SerializeField] SpriteRenderer playerSprite;

//Movement
private Vector2 movement, look;
private Vector2 velocityRef = Vector2.zero;

//Components
private PlayerControls playerControls;
private Rigidbody2D rb;
private GunController[] gunControllers;
private Animator animator;

//Animation
private string currentAnimation = "";

public static LookDirection CurrentLookDirection { get; private set; } = LookDirection.Down;
public enum LookDirection
{
Left,
Right,
Up,
Down
}


void Start()
{
playerControls = new PlayerControls();
rb = GetComponent<Rigidbody2D>();
gunControllers = GetComponentsInChildren<GunController>();
animator = GetComponent<Animator>();
//Cursor.visible = false;
}
/*
void FixedUpdate()
{
movement.Set(InputManager.Movement.x, InputManager.Movement.y);
rb.linearVelocity = Vector2.SmoothDamp(rb.linearVelocity, movement * moveSpeed, ref velocityRef, smoothTime);
}*/
void FixedUpdate()
{
// Get player input movement
movement.Set(InputManager.Movement.x, InputManager.Movement.y);

// Smooth velocity update
rb.linearVelocity = Vector2.SmoothDamp(rb.linearVelocity, movement * moveSpeed, ref velocityRef, smoothTime);

// Define the pixel grid size
float pixelSize = 1f / 16f;

Vector2 correctedVelocity;

// Snap the position to the grid
correctedVelocity.x = Mathf.Round(rb.linearVelocity.x / pixelSize) * pixelSize;
correctedVelocity.y = Mathf.Round(rb.linearVelocity.y / pixelSize) * pixelSize;

rb.linearVelocity = correctedVelocity;
}



private void Update()
{
look = InputManager.Look;

foreach (GunController gun in gunControllers)
{
gun.LookPosition = look;
}

CurrentLookDirection = GetLookDirection(look);
//Debug.Log("Looking: " + CurrentLookDirection);

ProcessLookDirection();
AnimateMovement();

}

private void AnimateMovement()
{
if (CurrentLookDirection == LookDirection.Down)
{
if (movement != Vector2.zero)
{
animator.Play("Player_WalkDown");
}
else
{
animator.Play("Player_IdleDown");
}
}
else if (CurrentLookDirection == LookDirection.Right || CurrentLookDirection == LookDirection.Left)
{
if (movement != Vector2.zero)
{
animator.Play("Player_WalkSide");
}
else
{
animator.Play("Player_IdleSide");
}
}
else if (CurrentLookDirection == LookDirection.Up)
{
if (movement != Vector2.zero)
{
animator.Play("Player_WalkUp");
}
else
{
animator.Play("Player_IdleUp");
}
}
}

public LookDirection GetLookDirection(Vector2 point)
{
Vector2 objectPosition = transform.position;
Vector2 direction = point - objectPosition;

if (Mathf.Abs(direction.x) > Mathf.Abs(direction.y))
{
return direction.x > 0 ? LookDirection.Right : LookDirection.Left;
}
else
{
return direction.y > 0 ? LookDirection.Up : LookDirection.Down;
}
}

private void ProcessLookDirection() {

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

r/Unity3D

I have created a free tool with unity with which you can easily create bouncy ball shorts with many different settings to change.
https://jf-development-01.itch.io/bouncyball-creator

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

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

r/Unity3D

Which one do you think looks the most aesthetically pleasing?
https://redd.it/1imo578
@r_Unity3D

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

r/Unity3D

Hopefully easy noob question re. Unity's 2d Roguelike tutorial Add Food Resource challenge

New to Unity and going through the 2d Roguelike tutorial. No issues until the first challenges section (part 6) in the "Add A Food Resource" section (link below). Is there anywhere with a useful repository, video, anything to refer to with better guidance:

EASY: Instead of always generating five food prefabs, have your game generate a random number of food based on a range we can customize in the inspector.

I can do this in the code with no issue but can’t figure out how to get it added to the inspector so it is customizable there. I am not even sure if it should be going in the SmallFood prefab Inspector area or the BoardManager.

I am sure these things are very obvious to everyone else experienced here but I am stumped and frustrated after googling and testing for way too long. I am sure I am overcomplicating it but could use help, please. Thanks

Link to relevant section:

https://learn.unity.com/tutorial/66f53fc0edbc2a0e824400de?uv=6&amp;courseId=66fa6d33edbc2a141af15aae#66f6bde9edbc2a06dc1877fb

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

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

r/Unity3D

[for hire] 🎨 Experienced Artist offering Custom Character Design Sheets/Boards for Your Projects!

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

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

r/Unity3D

Need ressources to solidify my knowledge on Unity programming

Hello,
I have been learning code as a self-taught developer since high school, and now, I'm in my second year of college, but I am not studying computer science.

I have been creating a game with a friend for 1 month, and I have been programming and learning on Unity for 6 months. But even though I have learnt the basics of C# and Unity, I have really had difficulties understanding more complex programming concepts, like having a smooth feel for the player movement. I feel like it's a separate world between me and people that are a bit "professional" in videogame development.

But, when I try to find some tutorials for more advanced people in programming, I don't find anything, and I can't learn more complex programming at school.

So, I wanted to know if you have some resources, written or video-based, to solidify my knowledge of videogame development and programming. It can be long articles, detailed videos, or even some paid resources.

I really want to be very good at programming because, if I can, I want to work in this industry, even if it's not the best period for video games right now.

Sorry if my English is not very good, it's not my mother tongue \^\^'
Thanks!

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

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

r/Unity3D

It’s work related
https://youtu.be/BmYPzTOxxY4?si=sT_ZDN9XNgyA4VeY

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

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

r/Unity3D

"Skull Rainbow" coming soon ...,
https://redd.it/1im9ffk
@r_Unity3D

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

r/Unity3D

How to setup your UI for navigation with keyboard and gamepad in Unity (Tutorial)
https://www.youtube.com/watch?v=sQpjgcX-jH8

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

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

r/Unity3D

I wanted to outline my assets with an outline shader, but it seems that the shader can't draw outside my asset bouds and that it's taking into account the adjacent assets of my tilesheet (yellow right vertical band). Do you know any solution to fix those ? Vertical thickness issue also...
https://redd.it/1im4s0x
@r_Unity3D

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

r/Unity3D

This is 40 very complex configurable joints controlled by 4 players trying coop. I just love physics driven gameplay. 💥

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

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

r/Unity3D

Made enemies able to destroy walls so you can't hide :)

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

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

r/Unity3D

Made this Game In 3 hours for the trijam, really proud of what I managed to achieve!
https://bancachuliasis.itch.io/flameofsteel

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

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

r/Unity3D

New Devlog! A Frog game about paying Child Support & Gambling!

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

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