News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).
I tried making Hogwarts Legacy map opening effect. Would love to hear your feedback!
https://redd.it/1jh7o69
@r_Unity3D
Animation triggering despite NO transitions to it
Dealing with a very annoying issue right now. I had originally set a blend tree called "Motion" as my default state, which blended an "Idle" state and a "Walking" state. In my original game, the main character, a crab was shelled.
I decided to make a change where now you start without a shell. So I set a default blend tree "NoShell", which blends idle and walking animations of the player with no shell.
For some baffling reason, no matter what, it plays a single frame from "Motion" every time I jump. Only when I jump. In my code I have explicitly set OnCollisionExit to play "NoShell". And it works, except for a *single frame* at the beginning of the animation. My animator doesn't show any transition to motion when jumping, it just plays it for a frame. None of the transitions (which I've muted) have any condition for jumping and there is no yVelocity parameter.
I've scoured my code for anything that would be overriding this and don't see anything. I can share my script but it's like 1200 lines long at this point.
Any help would be so appreciated, this is driving me crazy! (By the way, I am keeping the "Motion" blend tree, which shows the player shelled, because at a later point, I will need to use it in the game, when the player acquires a shell.)
https://preview.redd.it/03xnti63e8qe1.png?width=726&format=png&auto=webp&s=f143521befad5d674c0f10371abcdb065343765c
https://redd.it/1jh6yg3
@r_Unity3D
We’ve reached an important milestone: this isn’t just any location… it’s the 100th in Whirlight - No Time Trip, our brand-new point-and-click adventure!
What secrets lie within this ancient mansion, the new destination in Hector and Margaret’s time-traveling adventure?
https://redd.it/1jh4sqx
@r_Unity3D
"Dripping" effect created with particles in my game's main menu, what do you think?
https://www.youtube.com/watch?v=KMOM4j8SAR4
https://redd.it/1jh49o1
@r_Unity3D
How to instantiate object again after destroying it
Hi. I have a script that dictates how an object (tentacle) would move and also how much health it has (tentaclemove1) and a script that spawns said object (tentaclespawn). I'm trying to make it so that the tentacles won't spawn on top of each other, basically making it only spawn in the same place AFTER the previous one has been destroyed.
I made a boolean to check this in (tentaclemove1), which is (tenAlive). Upon death, (tenAlive) is set to False before being destroyed. After being set to False, a new instance of the object will be spawned via an if !ten1.tenAlive and (tenAlive) will be set to True in the same If statement in (tentaclespawn).
This didn't work as I expected however. Only one instance of the object would be spawned and nothing else. I've been at it for a while now, so any help is appreciated!
tentaclemove1:
public float moveSpeed = 1;
public bool tenAlive;
[SerializeField\] float health, maxHealth = 4f;
// Start is called before the first frame update
void Start()
{
health = maxHealth;
}
// Update is called once per frame
void Update()
{
transform.position = transform.position + (Vector3.right * moveSpeed) * Time.deltaTime;
}
private void OnCollisionEnter2D(Collision2D collision)
{
takeDamage(1);
Debug.Log("-1 hp!");
transform.position = new Vector3(-14.5f, 0, 0 );
}
public void takeDamage(float dmgAmount)
{
health -= dmgAmount;
if (health <= 0)
{
tenAlive = false;
Destroy(gameObject);
Debug.Log("dead");
}
}
tentaclespawn:
public GameObject tentacle;
public tentaclemove1 ten1;
public float spawnRate = 5;
private float timer = 0;
void Start()
{
spawnTen();
}
// Update is called once per frame
void Update()
{
if (timer < spawnRate)
{
timer += Time.deltaTime;
}
else
{
if (!ten1.tenAlive)
{
spawnTen();
timer = 0;
ten1.tenAlive = true;
}
}
}
void spawnTen()
{
Instantiate(tentacle, new Vector3(-15, 0, 0), transform.rotation);
https://redd.it/1jh2nvx
@r_Unity3D
There’s a will but is there a way?
I purchased a udemy course to learn more about unity 2d dungeon style game creation. The tutorial was great and I learned a lot and was able to solve most issues on my own afterwards but the only problem are the enemies…
My game utilizes the “drunken walker” to always randomize a map so players can’t memorize anything. Throughout searching the dungeon there are multiple challenges, one being an “invisible” block that increases a players heartbeat and decreases their vision. To stop this from happening the player has the option to shift walk through the dungeon to avoid these things from being triggered (basically a sneak).
The normal enemies are supposed to be around to stop players from “sneaking” through the dungeon the entire time but the tutorials enemy chase I was using doesn’t work. If the player is in range sometimes the enemy will take a step closer, sometimes they take a step backwards, sometimes they wait until the player moves again.
The tutorial never taught my about rigidbody2d but instead focused on collisionbox2d and player.transform and transform.position. I’ve watched tutorials on rigidbody and when I add it in the enemies just walk through walls. Other times the enemy just shakes on the tile they spawned on. So my question is, is there an actual way to make enemies chase the player when in range using this method? Or do I need to start over and learn rigidbody in order to get this to work?
https://redd.it/1jgy1i7
@r_Unity3D
What is wrong with my code for Wall Jumping?
Could anybody help me figure out why my wall jumping isn't working for my game? Ive searched tons of tutorials and discussions trying to understand why it isnt functioning properly but they are all written similarly with their movement. Here is the code
Rigidbody2D rb;
GameController gameCon;
BoxCollider2D bc;
public float speed, jumpForce;
float direction;
bool lWall, rWall, wallSliding;
[SerializeField\] LayerMask ground;
[SerializeField\] ParticleSystem walkParticles;
void Start()
{
rb = gameObject.GetComponent<Rigidbody2D>();
gameCon = GameObject.Find("GameController").GetComponent<GameController>();
bc = gameObject.GetComponent<BoxCollider2D>();
}
void Update()
{
Movement();
//Walk particle system
if (Grounded() && direction != 0 && !walkParticles.isPlaying) walkParticles.Play();
else if(walkParticles.isPlaying && direction == 0 || !Grounded()) walkParticles.Stop();
}
void Movement() {
//WASD + Jump
direction = Input.GetAxisRaw("Horizontal");
if (direction > 0) transform.rotation = new Quaternion(0, 0, 0, 0);
if (direction < 0) transform.rotation = new Quaternion(0, 180, 0, 0);
rb.velocity = new Vector2(speed * direction, rb.velocity.y);
if (Grounded()) {
if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.W))
{
rb.AddForce(Vector2.up * jumpForce, ForceMode2D.Impulse);
}
}
//Wall Jumping
rWall = Physics2D.Raycast(new Vector2(bc.bounds.max.x, transform.position.y), Vector2.right, 0.2f, ground);
lWall = Physics2D.Raycast(new Vector2(bc.bounds.min.x, transform.position.y), Vector2.left, 0.2f, ground);
if (rWall && !Grounded()) {
wallSliding = true;
if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.W)){
rb.velocity = new Vector2(-100, 10);
Debug.Log("R Wall Jump");
}
}
else if (lWall && !Grounded()) {
wallSliding = true;
if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.W))
{
rb.velocity = new Vector2(100, 10);
Debug.Log("L Wall Jump");
}
}
}
bool Grounded() {
BoxCollider2D collider = GetComponent<BoxCollider2D>();
return Physics2D.BoxCast(collider.bounds.center, collider.bounds.size, 0, Vector2.down, 0.1f, ground);
}
I'm thinking it could be something with the input Axis preventing the velocity of X from being changed but all the tutorials I've seen online have it set up the same way so I don't understand where I am getting it wrong. I've tried using AddForce too but it doesn't do anything.
https://redd.it/1jgxaup
@r_Unity3D
My first game made with another developer! It's a multiplayer boulder-rolling Sisyphus game. I like to think it's a metaphor for how gamedev feels
https://redd.it/1jgmpaf
@r_Unity3D
Slowly getting this boss to be a half decent fight
https://redd.it/1jgglq3
@r_Unity3D
I have found the best option to simulate sound occlusion efficiently
https://redd.it/1jghhuq
@r_Unity3D
Finally released my first rage motion sick game on Steam!
https://redd.it/1jgdfyd
@r_Unity3D
Perfect coffee stains every time! The SplineSprite tool has a wide variety of options to create procedural, vector-based sprites.
https://redd.it/1jgdwud
@r_Unity3D
I updated the gore, improved the SFX/VFX, and added some epic beats for the Sword Hero project, where your options in the open world are almost limitless.
https://redd.it/1jgc3zm
@r_Unity3D
I'm trying to learn probuilder, is this good for about 6 hours of practicing? (3 were spent on a different map, I made this in about 1 hour yesterday and 2 hours today.)
https://redd.it/1jg5n6o
@r_Unity3D
I made a retro shader to pixelate the screen. Do you think this is good or should i decrease it?
https://redd.it/1jh6dv8
@r_Unity3D
How does fake 3D work?
I've stumbled upon this video: https://www.youtube.com/watch?v=wuUXPRzPC3E&ab\_channel=Wo%C5%BAniakowski
How could I make this with Unity? In description of the video, he says something about calculating angles. But I don't get it.
https://redd.it/1jh4l6b
@r_Unity3D
What do you think about the menu design and rope physics?
https://redd.it/1jh4a43
@r_Unity3D
Looking Forward to Your Thoughts on My Co-op Party Game
https://redd.it/1jh2n4q
@r_Unity3D
Requesting for a tutor
Is there anyone here for 2d unity gameengine tutoring? I really need a tutor as I have lots of questions.
https://redd.it/1jh15f7
@r_Unity3D
Adding animation makes pixel character shift one pixel to the side
I wanted to add an idle animation for my pixel character. However, once I import the animation and play it, everything goes smoothely until I hit one frame where the slice outline has to extend one pixel to the right because I added a strand of hair "flying" to the exhale portion of the animation. I'm assuming this is because the slicing is snapping to the character and when the outline has to extend by one pixel on that specifc frame, it shifts the whole character to the left.
How do I go about fixing this?
https://redd.it/1jgyhr6
@r_Unity3D
As an inexperienced team, terrain has been a huge struggle. But in the past year, I think we’ve definitely gotten somewhere. Any thoughts and tips would be greatly appreciated!
https://redd.it/1jgpyjq
@r_Unity3D
Why do shadows look bad in Unity 6? Why is this happening?
https://redd.it/1jgkfza
@r_Unity3D
Ah, the sweet smell of the cactus flower 12 days before the launch. A fresh game-play clip from 'Elroy and the Aliens'.
https://redd.it/1jgilby
@r_Unity3D
Testing a object avoiding algorithm
https://redd.it/1jggppx
@r_Unity3D
2 years progress on our game
https://redd.it/1jge6rk
@r_Unity3D
Made a Strategy-Survival Game in 2.5 Months with Unity2D – Would Love Your Feedback!
https://redd.it/1jgd5d6
@r_Unity3D
Funny bug I accidentally discovered due to camera shake (secret third person mode)
https://redd.it/1jg15x2
@r_Unity3D
Why does spriteshape suck so much?
If you make a vertex "curved", the adjacent vertices are unable to to use "corner sprites"... how is this not just broken functionality. You can have 2 linear vertices adjacent to 1 curved, and that 1 curved vertex will disable corner sprites for the adjacent linear vertices.
There is no way to avoid this, so you either have to use curved for everything or "broken" vertices, or linear for everything.
And also with linear vertices with edges, the edge sprites are broken at the ends, corner sprites are supposed to fill in those breaks but its tedious to make 8 different corner sprites, when some kind of stretch implementation could be done even with linear vertices.
This whole edge system is so unfun to use, pretty much just the basic shape and fill features are pain free to use, if you're gonna have edges, might as well use line renderer....
https://redd.it/1jg7jms
@r_Unity3D
Trigger Collision not working
I am kind of new to unity coding and I am trying to code a feature for the menu where when you hover over a button it lights up. I am trying to do this with sprite arrays that rely on a bool that depends on whether or not the cursor is colliding with the button causing for it to trigger. The else statement is working but not the if statement. I tried to check if they were on the same z axis and they are, I’ve tried giving them rigid bodies, checking for the trigger function and I don’t think it’s a cursor problem because I’ve tried using other objects to collide with it but it’s still not working. What’s wrong with the code?
https://preview.redd.it/0do4352yeype1.png?width=785&format=png&auto=webp&s=8be80b507ec9bff67c940406420a70ab3a42b28c
https://redd.it/1jg6mmj
@r_Unity3D