News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).
2D character for my game
https://redd.it/1g8q7jt
@r_Unity3D
HasKey help
I just don't understand what is going on. I started making a scrolling plane shooter level for my game and i want to keep the same mechanics in my world map. In my world map the best time and amount of collectables is saved but for some reason i cannot get my time to save. can anyone educate me? this is my game manager script for my plane. the amber (collectable) works. I do have a seperate game manager for my 2dplatformer levels that manages a hasKey for time but im just lost. I need help
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class PlaneGameManager : MonoBehaviour
{
public static PlaneGameManager Instance;
public int currentLives = 3;
public float respawnTime = 2f;
public int amberCollected;
public float timeInLevel;
public string levelToLoad;
// Start is called before the first frame update
private void Awake()
{
Instance = this;
}
private void Start()
{
UIController.instance.livesText.text = "" + currentLives;
timeInLevel = 0;
}
private void Update()
{
timeInLevel += Time.deltaTime;
}
public void KillPlayer()
{
currentLives--;
UIController.instance.livesText.text = "" +currentLives;
if(currentLives > 0)
{
//respawn logic
StartCoroutine(PlaneRespawnCo());
}
else
{
UIController.instance.ShowGameOver();
WaveManager.instance.canSpawnWaves = false;
}
}
public IEnumerator PlaneRespawnCo()
{
yield return new WaitForSeconds(respawnTime);
PlaneHealthManager.instance.Respawn();
WaveManager.instance.canSpawnWaves = true;
}
public IEnumerator EndLevelCo()
{
PlaneController.instance.SetCanMove(false);
AudioManager.instance.PlayLevelVictory();
UIController.instance.levelCompleteText.SetActive(true);
yield return new WaitForSeconds(5);
UIController.instance.FadeToBlack();
yield return new WaitForSeconds((1f / UIController.instance.fadeSpeed) * 2);
PlayerPrefs.SetInt(SceneManager.GetActiveScene().name + "_unlocked", 1);
PlayerPrefs.SetString("CurrentLevel", SceneManager.GetActiveScene().name);
if (PlayerPrefs.HasKey(SceneManager.GetActiveScene().name + "_amber"))
{
if (amberCollected > PlayerPrefs.GetInt(SceneManager.GetActiveScene().name + "_amber"))
{
PlayerPrefs.SetInt(SceneManager.GetActiveScene().name + "_amber", amberCollected);
}
}
else
{
PlayerPrefs.SetInt(SceneManager.GetActiveScene().name + "_amber", amberCollected);
}
if (PlayerPrefs.HasKey(SceneManager.GetActiveScene().name + "_time"))
{
if (timeInLevel < PlayerPrefs.GetFloat(SceneManager.GetActiveScene().name + "_time"))
{
PlayerPrefs.SetFloat(SceneManager.GetActiveScene().name + "_time", timeInLevel);
}
}
else
{
PlayerPrefs.SetFloat(SceneManager.GetActiveScene().name + "_time", timeInLevel);
}
SceneManager.LoadScene(levelToLoad);
}
}
and this is my script for the map
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MapPoint : MonoBehaviour
{
public MapPoint up, down, left, right;
public bool isLevel;
public string levelToLoad, levelToCheck, levelName;
public bool isLocked;
public int amberCollected, totalAmber;
public float bestTime, targetTime;
public GameObject amberBadge, timeBadge;
public Animator starAnimation;
void Start()
{
starAnimation = GetComponentInChildren<Animator>();
if (isLevel && levelToLoad != null)
{
if(PlayerPrefs.HasKey(levelToLoad + "_amber"))
{
amberCollected = PlayerPrefs.GetInt(levelToLoad + "_amber");
}
if (PlayerPrefs.HasKey(levelToLoad + "_time"))
{
bestTime = PlayerPrefs.GetFloat(levelToLoad + "_time");
}
if(amberCollected >= totalAmber)
{
amberBadge.SetActive(true);
}
if(bestTime <= targetTime && bestTime != 0)
{
timeBadge.SetActive(true);
}
isLocked = true;
if(levelToCheck != null)
{
if(PlayerPrefs.HasKey(levelToCheck + "_unlocked"))
{
if(PlayerPrefs.GetInt(levelToCheck + "_unlocked") == 1)
{
isLocked = false;
}
}
}
}
if(levelToLoad == levelToCheck)
{
isLocked =
If you're too lazy to make a game then come to me
I'll create a normal game for 5/10 dollars😅 except online or VR and AP I'll do anything write in the comments anything up to complaints and orders :/ I'm saving up for beat saber
https://redd.it/1g8kpot
@r_Unity3D
Visualizing a tree
i'm having a difficult time trying to visualize a tree
are there any methods out there that allows one to do things like this?
https://redd.it/1g7oky4
@r_Unity3D
What does every little rock need to eat in order to grow up to be a big rock? Why it's rocks silly!
https://redd.it/1g7ea16
@r_Unity3D
My work in progress procedural planetary map generator for my upcoming sci-fi survival game. What do you guys think about it?
https://redd.it/1g7gnis
@r_Unity3D
Made a stunning fantasy stylized environment in Unity!
https://redd.it/1g7bumc
@r_Unity3D
I've created a virus corruption effect which is fully dynamic without using decals in HDRP. We needed it to clear dynamically as a result of finishing a level, so I used a mix of noise and signed distance fields to achieve this effect. Do you think it looks good enough?
https://redd.it/1g7aqm1
@r_Unity3D
Update on the rocket exhaust plume animation from my previous post. Thank you for your feedback!
https://redd.it/1g76j2o
@r_Unity3D
Mini-Tip: Get more natural-looking behaviour from your NavMeshAgents with NavMeshObstacles
https://preview.redd.it/mqjohxz2movd1.png?width=863&format=png&auto=webp&s=e9d5bb8e5c205298360d41219ee85ba5fdc97dd2
Adding capsule NavMeshObstacles at the corners will cause your agents to path more naturally down the middle of corridors rather than wall-scraping, whilst still allowing them to fit through doors (which changing the radius of the agent would prevent).
https://redd.it/1g757vz
@r_Unity3D
Subnautica 2 ditches Unity for Unreal Engine. Thoughts?
The new Subnautica 2 trailer just dropped and it's been revealed it's being built in Unreal Engine.
I found this surprising as the first game, and it's expansion Below Zero, where both built in Unity. Subnautica was a good example of a big game built in Unity, so it feels a little confronting to see them decide to recode their game from scratch rather than continuing to use Unity.
Why do you think they made this decision? Why is it so hard for Unity games to "look as good" as Unreal Games.
https://redd.it/1g6vcl6
@r_Unity3D
Using Unity's scriptable physics feature to create a predictive aiming system.
https://redd.it/1g6ueeu
@r_Unity3D
CRUST SHMUP OUT NOW ON STEAM (Me and my professors first game together a punk-inspired shoot em' up influenced by napalm deaths album SCUM)
Me and my professor have been working on this shoot em up game for a while together and it finally has made it to the steam store.
CRUST PUNK SHOOT 'EM UP. BLAST BEAT BULLET HELL. HARDCORE ANARCHO ARCADE ACTION. BRUTAL, BLEAK, SHORT AND INTENSE. NO SCORE, NO LEADERBOARDS, NO GODS, NO MASTERS. CAVE MEETS NAPALM DEATH.
(Its our first game together and our first game on Steam, and to have available to everyone FREE to play is really big for both of us, so thank you for all who choose to play and please wishlist if you can <3)
https://store.steampowered.com/app/3157260/CRUST\_SHMUP
https://redd.it/1g6ubz6
@r_Unity3D
Progress on our 2.5D racer NightShift. What do you think?
https://redd.it/1g6nlrv
@r_Unity3D
I downloaded Unity 6 yesterday after release, I love package manager window's design. It seem different from old version. What do you think about it?
https://redd.it/1g6jvrd
@r_Unity3D
false;
}
if(amberCollected >= totalAmber && bestTime <= targetTime && bestTime != 0)
{
starAnimation.SetBool("ActivateStars", true);
}
}
}
https://redd.it/1g8onkn
@r_Unity3D
I made a title scene for my 3D pixel art game. What do you think?
https://redd.it/1g8hgp4
@r_Unity3D
Could someone please tell me why the line renderer is not pointing to the hit position of the raycast?
https://redd.it/1g7rjoo
@r_Unity3D
I thought I would share my progress on my dream game that I started 10 years ago
https://redd.it/1g7mtul
@r_Unity3D
A question about 2d attack animations and colliders.
Hi, I'm working on some attack animations (ignore the player hit box I need to move it) I'm just not really sure the best way to do the collider with the attack animation. I am currently having a game object under the player called weapon collider which is disabled and I was going to turn it on and off at certain intervals during the animation. I'm going to end up with lots of enemies and I've read having polygon colliders uses a lot more resources than using box/circle colliders, even if you end up using more of them.
I guess my question is, is how I've set them up below OK? Should I setup another child object for a 2nd weapon collider and make it closer to the actual shape of the weapon on the right? I guess for the player it wouldn't be too bad as it would be a bit more forgiving but for the enemies I just want to check, especially as I've got about 20.
Is there a better way of going about doing what I'm trying to achieve? Does what I'm asking even make sense? Thanks
https://preview.redd.it/kq44oc5exrvd1.png?width=1525&format=png&auto=webp&s=2928968858324c0887635819d87005f31e0ad639
https://redd.it/1g7i683
@r_Unity3D
7 months of progress: First prototype vs. the current build
https://redd.it/1g7fatb
@r_Unity3D
My First Android Game : Classic Archery! Reviews Welcome!!
https://www.youtube.com/watch?v=HLyyLh8oUe4
https://redd.it/1g7d411
@r_Unity3D
What do you think would be a suitable price for our puzzle game 'Nurikabe World'
https://redd.it/1g7a8e4
@r_Unity3D
How can one achieve this post-process effect in Unity?
https://redd.it/1g75muf
@r_Unity3D
Small showcase of how my retro shoot-'em-up game, CHROMADI has evolved over the last couple of months
https://redd.it/1g737r9
@r_Unity3D
Could someone help me figure out why it’s not spawning where I need it to
https://redd.it/1g6wpao
@r_Unity3D
What Rocket Engine Animation looks better, Top (more realistic) or Bottom (more fiery)?
https://redd.it/1g6q91g
@r_Unity3D
Finally released the Steam Page of my game! This is the 1 year and 3 months (and 1 day!) progress so far :)
https://redd.it/1g6km6p
@r_Unity3D
6+ Years of progress.
https://redd.it/1g6j4eg
@r_Unity3D
200k trees optimized from 5 to 144+ FPS
https://redd.it/1g6lg0q
@r_Unity3D