Help with is trigger box collider
Continuation of previous issue - https://www.reddit.com/r/Unity2D/comments/1hg0mz9/player\_wall\_hanging\_issue/
So I'm trying to make it so that my head collider doesn't collide with walls and other terrain but can still collide with traps. The head collider is just another 2D box collider as part of the entire Donkey game object and the head collider is set to is trigger.
The head collider doesn't interact with walls (yay) but i do want it to collide with traps which it isn't doing in the image below. My code is attached.
using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Death : MonoBehaviour
{
private Rigidbody2D rb;
private Animator anim;
SerializeField private AudioSource deathSoundEffect;
private bool isPlayerAlive = true;
private void Start()
{
rb = GetComponent<Rigidbody2D>();
anim = GetComponent<Animator>();
}
private void OnCollisionEnter2D(Collision2D collision)
{
if (isPlayerAlive && collision.gameObject.CompareTag("Trap"))
{
Die();
}
}
// -------This is the part i added for head collider----------------------------
private void OnTriggerEnter2D(Collider2D other)
{
if (isPlayerAlive && other.CompareTag("Trap") && other.gameObject.CompareTag("Head"))
{
Die();
}
}
// -------above is the part i added for head collider----------------------------
public void Die()
{
if (isPlayerAlive)
{
isPlayerAlive = false;
rb.bodyType = RigidbodyType2D.Static;
anim.SetTrigger("death");
deathSoundEffect.Play();
StartCoroutine(RestartLevelAfterDelay(2f));
}
}
private IEnumerator RestartLevelAfterDelay(float delay)
{
yield return new WaitForSeconds(delay);
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
}
https://preview.redd.it/vgrzizovyk7e1.png?width=442&format=png&auto=webp&s=132b0d39a5336c2bb4fe1519108d32512bada0ac
https://redd.it/1hgyj3l
@r_Unity3D
Continuation of previous issue - https://www.reddit.com/r/Unity2D/comments/1hg0mz9/player\_wall\_hanging\_issue/
So I'm trying to make it so that my head collider doesn't collide with walls and other terrain but can still collide with traps. The head collider is just another 2D box collider as part of the entire Donkey game object and the head collider is set to is trigger.
The head collider doesn't interact with walls (yay) but i do want it to collide with traps which it isn't doing in the image below. My code is attached.
using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Death : MonoBehaviour
{
private Rigidbody2D rb;
private Animator anim;
SerializeField private AudioSource deathSoundEffect;
private bool isPlayerAlive = true;
private void Start()
{
rb = GetComponent<Rigidbody2D>();
anim = GetComponent<Animator>();
}
private void OnCollisionEnter2D(Collision2D collision)
{
if (isPlayerAlive && collision.gameObject.CompareTag("Trap"))
{
Die();
}
}
// -------This is the part i added for head collider----------------------------
private void OnTriggerEnter2D(Collider2D other)
{
if (isPlayerAlive && other.CompareTag("Trap") && other.gameObject.CompareTag("Head"))
{
Die();
}
}
// -------above is the part i added for head collider----------------------------
public void Die()
{
if (isPlayerAlive)
{
isPlayerAlive = false;
rb.bodyType = RigidbodyType2D.Static;
anim.SetTrigger("death");
deathSoundEffect.Play();
StartCoroutine(RestartLevelAfterDelay(2f));
}
}
private IEnumerator RestartLevelAfterDelay(float delay)
{
yield return new WaitForSeconds(delay);
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
}
https://preview.redd.it/vgrzizovyk7e1.png?width=442&format=png&auto=webp&s=132b0d39a5336c2bb4fe1519108d32512bada0ac
https://redd.it/1hgyj3l
@r_Unity3D
Reddit
From the Unity2D community on Reddit: Player wall hanging issue
Explore this post and more from the Unity2D community
This media is not supported in your browser
VIEW IN TELEGRAM
Prototyping Dreadkeeper: Manage your cemetery during the day, prevent zombies from escaping at night, and avoid getting eaten in the process! It’s a horror simulation meets FPS survivor-like game. Should we keep digging into this idea? Your feedback is welcome! Made with Unity!
https://redd.it/1hh0kf5
@r_Unity3D
https://redd.it/1hh0kf5
@r_Unity3D
FFT style combat game - 2d or 2.5d?
I want to make a game that uses turn based tactics and units move around just like chess pieces on a grid, except they can move up to higher terrain. I want the camera to be angled on the grid so you can more easily see the differences in elevation. I want to use detailed sprites for my game. So very similar to Final Fantasy Tactics but I am adding lots of unique mechanics. I do not think the camera will turn. Should I make it a 2d game or a 2.5d game.
https://redd.it/1hh37n0
@r_Unity3D
I want to make a game that uses turn based tactics and units move around just like chess pieces on a grid, except they can move up to higher terrain. I want the camera to be angled on the grid so you can more easily see the differences in elevation. I want to use detailed sprites for my game. So very similar to Final Fantasy Tactics but I am adding lots of unique mechanics. I do not think the camera will turn. Should I make it a 2d game or a 2.5d game.
https://redd.it/1hh37n0
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
This media is not supported in your browser
VIEW IN TELEGRAM
I've updated the turret in my game, Dead Engine. How do you think my new turret looks?
https://redd.it/1hh2j9b
@r_Unity3D
https://redd.it/1hh2j9b
@r_Unity3D
how to make bounce pad 2d unity that can jump in the way pad is facing
https://redd.it/1hh8yjb
@r_Unity3D
https://redd.it/1hh8yjb
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Calling for the removal of Frogsight's Moderator Status from the Official Unity Discord.
The discussion that started it all \*note\* I am not \/u\/Halfspacer
Fogsight thinks the situation is orchestrated by a bunch of trolls, however, it has grown to become a serious community moderation debacle. Not to mention they are virtue-signaling what kind of content is deemed \\"helpful.\\" I don't think anyone should be in charge of moderating \\"if a solution was not helpful enough.\\"
Another unjust ban! I've counted at least 4 bans regarding this situation now none of them justififed in my eyes.
My response to fogsight \(I had a friend message and ping them this\)
Fogsight's response! Remember all I did was react with 3 emojis expressing my disdain for how \/u\/Halfspacer was treated when accused of posting LLM code that they claim is NOT LLM.
It's incredible to me that the situation has developed this far in the span of a few hours, I was an avid contributor to the DOTS discussion thread. Although I have been inactive for 7 months (I stopped working on my passion project, and was busy with IRL) Fogsight deemed that I must be a troll and a spammer (3 emojis lol) and decided I deserved a rightful ban (and others who have come to my side to back me up)
https://redd.it/1hhbycn
@r_Unity3D
The discussion that started it all \*note\* I am not \/u\/Halfspacer
Fogsight thinks the situation is orchestrated by a bunch of trolls, however, it has grown to become a serious community moderation debacle. Not to mention they are virtue-signaling what kind of content is deemed \\"helpful.\\" I don't think anyone should be in charge of moderating \\"if a solution was not helpful enough.\\"
Another unjust ban! I've counted at least 4 bans regarding this situation now none of them justififed in my eyes.
My response to fogsight \(I had a friend message and ping them this\)
Fogsight's response! Remember all I did was react with 3 emojis expressing my disdain for how \/u\/Halfspacer was treated when accused of posting LLM code that they claim is NOT LLM.
It's incredible to me that the situation has developed this far in the span of a few hours, I was an avid contributor to the DOTS discussion thread. Although I have been inactive for 7 months (I stopped working on my passion project, and was busy with IRL) Fogsight deemed that I must be a troll and a spammer (3 emojis lol) and decided I deserved a rightful ban (and others who have come to my side to back me up)
https://redd.it/1hhbycn
@r_Unity3D
Our Unity tool is now 50% off for a limited time! Swap ANY variables, materials, and references with a single click or line of code in both Runtime and Editor.
https://redd.it/1hh82fx
@r_Unity3D
https://redd.it/1hh82fx
@r_Unity3D
Anyone got any tips for a new developer?
I'm tying to make a 2d game so if u have any it would be awesome
https://redd.it/1hh7ol4
@r_Unity3D
I'm tying to make a 2d game so if u have any it would be awesome
https://redd.it/1hh7ol4
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Animations that run at different FPS
Hey guys, I'm new to this, and I would like to build a 2D platformer, I was thinking about using Pixel Frog assets, for example:
https://pixelfrog-assets.itch.io/kings-and-pigs
https://pixelfrog-assets.itch.io/pirate-bomb
They seem great, the only thing is that some of them run at "20 FPS or 50 MS." and others at "10 FPS or 100 MS.", is this a problem? How do I manage it?
https://redd.it/1hhgk8p
@r_Unity3D
Hey guys, I'm new to this, and I would like to build a 2D platformer, I was thinking about using Pixel Frog assets, for example:
https://pixelfrog-assets.itch.io/kings-and-pigs
https://pixelfrog-assets.itch.io/pirate-bomb
They seem great, the only thing is that some of them run at "20 FPS or 50 MS." and others at "10 FPS or 100 MS.", is this a problem? How do I manage it?
https://redd.it/1hhgk8p
@r_Unity3D
itch.io
Kings and Pigs by Pixel Frog
A King vs an army of cute small Pigs
Unity 2D & Microsoft Visual Studio - noob question
When I search in microsoft visual studio for the "awake" function, it does not appear to be showing up? Tried to figure it out but im stumped.
Thanks
https://redd.it/1hhh65x
@r_Unity3D
When I search in microsoft visual studio for the "awake" function, it does not appear to be showing up? Tried to figure it out but im stumped.
Thanks
https://redd.it/1hhh65x
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Make trail follow player when teleporting
I am making a 2D unity game, and I am teleporting the player game object by adding a value to the player's x transform with a Vector2. I am enabling a trail renderer before the player teleports, and then a cooldown starts which will set the trail renderer to inactive once the cooldown is over. The trail should be over by the time it is set to inactive. My problem is that the trail isn't following the teleportation. After the teleport I can move around normally and see the trail, but I want it to follow the teleportation. Everything online is talking about removing the trail during the teleport, which is the opposite of what I want. Any help? I don't even know if what I am asking is possible with my current setup, so any help would be extremely helpful.
https://redd.it/1hhfhoy
@r_Unity3D
I am making a 2D unity game, and I am teleporting the player game object by adding a value to the player's x transform with a Vector2. I am enabling a trail renderer before the player teleports, and then a cooldown starts which will set the trail renderer to inactive once the cooldown is over. The trail should be over by the time it is set to inactive. My problem is that the trail isn't following the teleportation. After the teleport I can move around normally and see the trail, but I want it to follow the teleportation. Everything online is talking about removing the trail during the teleport, which is the opposite of what I want. Any help? I don't even know if what I am asking is possible with my current setup, so any help would be extremely helpful.
https://redd.it/1hhfhoy
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Inconsistent OnTriggerEnter2D results
Hey hey, I've been making a 2D side-scrolling game in which I have "custom physics", each entity has velocity which is updated via code. I'm doing it because I want to achieve "non-realistic" physics like a constant jump height no matter the impact velocity.
The only thing that isn't consistent, is the OnTriggerEnter2D reactions. Let's say an enemy bounces of the ground, it could bounce in a margin error of about 1 (0.5 up or down, which is pretty big IMO). Does anyone know a good way to get a more consistent outcome?
https://redd.it/1hhoqfo
@r_Unity3D
Hey hey, I've been making a 2D side-scrolling game in which I have "custom physics", each entity has velocity which is updated via code. I'm doing it because I want to achieve "non-realistic" physics like a constant jump height no matter the impact velocity.
The only thing that isn't consistent, is the OnTriggerEnter2D reactions. Let's say an enemy bounces of the ground, it could bounce in a margin error of about 1 (0.5 up or down, which is pretty big IMO). Does anyone know a good way to get a more consistent outcome?
https://redd.it/1hhoqfo
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Lighting Issue
I'm using the URP to work with my Normal Maps for my game project. Lighting is meant to play a bit of a part in how some of the enemies function, but the lighting itself is acting... well, the picture should say it all.
https://preview.redd.it/ot1tmlzhur7e1.png?width=249&format=png&auto=webp&s=e386596feb9342afef3821db7c7ae9fcd4cbce65
When it's set to interact with the normal maps, the Light itself is always behind the midpoint of the light object. The Spot is just to showcase the issue, and I've verified that the green channels are correct as best that I can (the person who made the Normal Maps has experience with making them). What am I doing wrong that's causing this oddity? Flipping the green channel just flips with half gets the odd lighting along the X axis.
https://redd.it/1hhp2e9
@r_Unity3D
I'm using the URP to work with my Normal Maps for my game project. Lighting is meant to play a bit of a part in how some of the enemies function, but the lighting itself is acting... well, the picture should say it all.
https://preview.redd.it/ot1tmlzhur7e1.png?width=249&format=png&auto=webp&s=e386596feb9342afef3821db7c7ae9fcd4cbce65
When it's set to interact with the normal maps, the Light itself is always behind the midpoint of the light object. The Spot is just to showcase the issue, and I've verified that the green channels are correct as best that I can (the person who made the Normal Maps has experience with making them). What am I doing wrong that's causing this oddity? Flipping the green channel just flips with half gets the odd lighting along the X axis.
https://redd.it/1hhp2e9
@r_Unity3D
I've reworked graphics of my game (Unity2D) after initial feedback. Here is the new trailer!
https://www.youtube.com/watch?v=mBlPIe_DDtg
https://redd.it/1hhq9o3
@r_Unity3D
https://www.youtube.com/watch?v=mBlPIe_DDtg
https://redd.it/1hhq9o3
@r_Unity3D
YouTube
Worlds Explorers - Announcement Trailer
Stranded on a mysterious alien world, your crew must fix the ship, and leave the planet. To survive, players must adapt to each planet’s unique challenges by hunting alien wildlife for food, gathering vital resources, and interacting with advanced alien civilizations.…
Discord containment thread
We are a week away from Christmas.
The professional thing would be to waltz out some cooperate sounding apology speak addressing the current situation. But remember us mods are rarely ever that smart. As for the mods over on discord, we couldn't tell you a single thing about them. Because how could we? We're not affiliated with them. We just link there because this is the Unity place and that's what you do when you're the Unity place..
That being said, we believe that any wrongdoing or oversight on the behalf of Unity Technologies should be called out, but what we're NOT going to do is have r/Unity3D become the complaint forums for every last person's interaction with one alleged asshole, especially when there is no actionable path forward apart from making the drama as loud as possible, which might be better served some place like Twitter or Bluesky or some other official channel. Because in case some of you forgot, r/Unity3D and Unity Technologies, haven't exactly been the closest friends after the whole Runtime Fee scenario... remember that?
Please keep that in mind.
Because specifically, in just the past 12 hours following the initial post by one user u/Halfspacer, things have gotten really disorganized, really fast.
To any users who have had your thread's locked or removed, do understand that the initial complaint was levied at a specific discord Moderator, and not literally every negative interaction you've ever had with a Unity employee during the past 5+ years. That is unproductive, unhelpful, distracting from the initial post(s) and is a huge waste of yours and everyone else's time.
So here's a containment thread... enjoy.
https://www.youtube.com/watch?v=cK7RCMFkT78
https://redd.it/1hhm87e
@r_Unity3D
We are a week away from Christmas.
The professional thing would be to waltz out some cooperate sounding apology speak addressing the current situation. But remember us mods are rarely ever that smart. As for the mods over on discord, we couldn't tell you a single thing about them. Because how could we? We're not affiliated with them. We just link there because this is the Unity place and that's what you do when you're the Unity place..
That being said, we believe that any wrongdoing or oversight on the behalf of Unity Technologies should be called out, but what we're NOT going to do is have r/Unity3D become the complaint forums for every last person's interaction with one alleged asshole, especially when there is no actionable path forward apart from making the drama as loud as possible, which might be better served some place like Twitter or Bluesky or some other official channel. Because in case some of you forgot, r/Unity3D and Unity Technologies, haven't exactly been the closest friends after the whole Runtime Fee scenario... remember that?
Please keep that in mind.
Because specifically, in just the past 12 hours following the initial post by one user u/Halfspacer, things have gotten really disorganized, really fast.
To any users who have had your thread's locked or removed, do understand that the initial complaint was levied at a specific discord Moderator, and not literally every negative interaction you've ever had with a Unity employee during the past 5+ years. That is unproductive, unhelpful, distracting from the initial post(s) and is a huge waste of yours and everyone else's time.
So here's a containment thread... enjoy.
https://www.youtube.com/watch?v=cK7RCMFkT78
https://redd.it/1hhm87e
@r_Unity3D
YouTube
Merry chrysler Meme
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.