r/Unity3D – Telegram
r/Unity3D
259 subscribers
12.6K photos
15.5K videos
14 files
47.8K links
News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).
Download Telegram
Media is too big
VIEW IN TELEGRAM
My latest work on volumetric clouds for special effects including atmospheric lighting, lightning and vortexes, with controllable vortex radius, vorticity and speed.

https://redd.it/1hn9l6e
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
Why is white light being emitted from certain objects when viewed at a certain angle?

https://redd.it/1hn9v3n
@r_Unity3D
random walkable point A

I want to generate a random point within 5 units from my enemy where he can walk to so not outside the map and not in an wall. and i am having trouble programming it so it doesnt need to do 100 itterations until it finds a spot, becouse i want to have a lot of enemies. and then i want to use an A\
pathfinder to generate the path to it

https://preview.redd.it/ryfcddr2qd9e1.png?width=1095&format=png&auto=webp&s=ebad1a0df5d0f3a4cb890747d8b87371d8f9fc6d

i already created a green tilemap for where it can generate the points and where it cant, but this is just for the test and not the actual game, in the actual game it wil be a tilemap for everything and then where this is no walls i will make it green so the enemies know where to go to.


has anyone got any recomendations on how to program that becouse having a random inside circle somtimes generates a point outside the map and having it do 10 things until it works is not effecient for around 50 enemies at once

https://redd.it/1hndag6
@r_Unity3D
Charachter falling in top down shooter (need help)

I wanted to make a top down shooter in unity 2d but my charrachter is going to the bottom of the screen. I am using a box collider, and a Rigidbody 2d set to kinematic. I also have a noscript for moving the charrachter:

using System.Collections;

using System.Collections.Generic;

using UnityEngine;



public class PlayerController : MonoBehaviour

{

public float moveSpeed = 5f;

public GameObject bulletPrefab;

public Transform firePoint;



private Rigidbody2D rb;

private Vector2 movement;

private Vector2 mousePos;



void Start()

{

rb = GetComponent<Rigidbody2D>();

}



void Update()

{

// Get movement input

movement.x = Input.GetAxisRaw("Horizontal");

movement.y = Input.GetAxisRaw("Vertical");



// Get mouse position

mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);



// Shooting

if (Input.GetButtonDown("Fire1")) // Left mouse button

{

Shoot();

}

}



void FixedUpdate()

{

// Move the player

GetComponent<Rigidbody2D>().MovePosition(GetComponent<Rigidbody2D>().position + movement * moveSpeed * Time.fixedDeltaTime);



// Rotate to face the mouse

Vector2 lookDir = mousePos - GetComponent<Rigidbody2D>().position;

float angle = Mathf.Atan2(lookDir.y, lookDir.x) * Mathf.Rad2Deg;

GetComponent<Rigidbody2D>().rotation = angle;

}



void Shoot()

{

Instantiate(bulletPrefab, firePoint.position, firePoint.rotation);

}

}


This also has a shooting function which is working perfectly fine.

https://i.redd.it/4vak5j9tce9e1.gif

Here is what is happening

https://redd.it/1hnfdgm
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
I'm working on a live syntax highlighter and motion graphics tool to help teach shaders.

https://redd.it/1hnf0ot
@r_Unity3D
Reuse bone animation on sprites with different heights in 2D

Hey guys,


I have a technical question. Is it possible to reuse a skeleton and it's animations on a sprite with a bit different size/shape? I know you can use Sprite Library and the Resolver to swap character parts, but that only works if the sprites are similar in size etc. I want to make a character who is taller for example.

But is it possible to let's say duplicate the main character with it's bones and animations, change the sprite, reposition the bones so they fit the new sprite (since the new character would be taller) and then just adjust the animations if they are off?

My point is to somehow simplify the process of making a new character (a companion that uses the same animations as other companions, but is way taller). So I don't have to make all the animations from scratch again just because the character is taller even though they would use many of the same animations. Or if there is a way to retarget the animations to a different skeleton whose bones are named exactly the same or something like that. Or a way to copy-paste animations I want to reuse.

Thank you for any input!

https://redd.it/1hnevib
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
Some people wanted to see symmetry via the gravity so here we are. 2.000.000 objects.

https://redd.it/1hnijwd
@r_Unity3D
So small issue with my jump animation for my game

Basically, instead of what I see on tutorials (I'm a baby), they do a jump then fall for the animation but mine is just two sprites jump/fall in one to make it look like they're player is floating gently. I'm having trouble developing it to work and everything if anyone can tell my pea brain how to make it easier it would help

https://redd.it/1hnoats
@r_Unity3D
Why speedTime.deltaTime when only setting the Rigidbody's velocity?

I'm working on a two dimentional platformer that I already started.
I have already worked on the player's movements, but recently someone told me that for the movements he was setting the Rigidbody's velocity to horizontalSpeed\
Time.deltaTime.

I was wondering why they multiply by Time.deltaTime when only setting the velocity, because I think that Unity is already applying movements depending on the velocity in Unit per Second, am I right?

What is your opinion on this?

https://redd.it/1hnqh25
@r_Unity3D
This media is not supported in your browser
VIEW IN TELEGRAM
If you want to share a level with your friend in my Level Editor, send them a PNG!

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