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

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

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

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

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

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

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

r/Unity3D

Slowly getting this boss to be a half decent fight

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

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

r/Unity3D

I have found the best option to simulate sound occlusion efficiently

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

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

r/Unity3D

Finally released my first rage motion sick game on Steam!

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

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

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

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

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

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

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

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

r/Unity3D

Question
https://redd.it/1jg7k9k
@r_Unity3D

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

r/Unity3D

Platformer Tileset

If you're looking for some awesome tilesets for a platformer or 2d game you're working on, consider checking out my Platformer Tilesets asset. There are over 20 tilesets covering a wide array of environments. Each tileset has 38 tiles to cover any shape you need. https://beard-and-axe.itch.io/platformer-tilesets-pro

https://preview.redd.it/w3vqvm4f7ype1.png?width=224&amp;format=png&amp;auto=webp&amp;s=3b3211a33f11de0c786ed0c4b446b0ce0172a4c8



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

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

r/Unity3D

Coding help
https://redd.it/1jg39ug
@r_Unity3D

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

r/Unity3D

I have a render texture that downscales the resolution of the game, how do I also downscale the resolution of the textmeshpro text?
https://redd.it/1jfy6w0
@r_Unity3D

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

r/Unity3D

My first game is in early access! I am curious about your suggestions and comments.

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

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

r/Unity3D

I made an idle game using ecs, my first full time project. But it has no meta gameplay, would this still be called a game and will people play it?

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

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

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

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

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

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

r/Unity3D

Why do shadows look bad in Unity 6? Why is this happening?
https://redd.it/1jgkfza
@r_Unity3D

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

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

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

r/Unity3D

Testing a object avoiding algorithm

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

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

r/Unity3D

2 years progress on our game

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

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

r/Unity3D

Made a Strategy-Survival Game in 2.5 Months with Unity2D – Would Love Your Feedback!

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

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

r/Unity3D

Funny bug I accidentally discovered due to camera shake (secret third person mode)

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

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

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

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

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&amp;format=png&amp;auto=webp&amp;s=8be80b507ec9bff67c940406420a70ab3a42b28c



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

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

r/Unity3D

Is a NavMesh appropriate for moving 2D sprites across a Tilemap for a Shining Force homage?

What it says on the tin. All the turn based strategy tutorials I've found specific to Unity implement in 3D space, but I'm looking to go retro. I've implemented grid-based movement for town scenes pretty well but after looking up some GameMaker tutorials on this sort of thing (sergeant indie's Turn Based Strategy 101) I sense I will need more than just tracking movement, and I'd prefer to leverage Unity built ins.

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

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

r/Unity3D

Photos to Character Sprites

Reference: I teach High School game design.

If you were to want to have student developers turn themselves into 2D sprites via photo would it be best to:

A) do photos in a sort of stop motion style movement for walking, idle and jumping

Or

B) have them photo a T pose and then do rigging?

We haven’t really done rigging and our curriculum hasn’t called for it so I’m not 100% sure on which route I want to go for our future projects and I’m not completely solid on if 2d animation is done more via spritesheet animation or rigging anyway. I just feel like it would be an entertaining way of encouraging a little more buy in from the students that get overwhelmed with the idea of making their own sprites. No drawing needed if we can just snap some quick shots in front of a green screen and have Canva do the rest.

Thank you.


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

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

r/Unity3D

How to Make an Enemy Roam and Only Chase the Player/NPC When Spotted?

Hi, I'm trying to make an enemy that can attack and kill the Player or NPC, but I don't want it to always know their exact location. Instead, I want the enemy to roam around until it spots the Player or NPC before starting to chase them.

I'm not sure how to implement this. Any advice or resources would be appreciated!

Here is what i have so far.


using System.Collections;

using System.Collections.Generic;

using UnityEngine;



public class EnemyController : MonoBehaviour

{

public float moveSpeed = 2f;

Rigidbody2D rb;

public Transform target;

Vector2 moveDirection;



float health, maxHealth = 3f;



public int pointsOnDeath = 100; // Enemy score



private void Awake()

{

rb = GetComponent<Rigidbody2D>();

}



// Start is called before the first frame update

void Start()

{

health = maxHealth;

}



// Update is called once per frame

void Update()

{

if (target)

{

Vector3 direction = (target.position - transform.position).normalized;

moveDirection = direction;



}

}



private void FixedUpdate()

{

if (target)

{

rb.velocity = new Vector2(moveDirection.x, moveDirection.y) * moveSpeed;

}

}



public void TakeDamage(float damage)

{

health -= damage;



if (health <= 0)

{

// Give this enemy’s specific score value when it dies

ScoreManager.instance.AddPoints(pointsOnDeath);



Destroy(gameObject);

}

}



}



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

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

r/Unity3D

subauzica inspired GameJam entry extended
https://youtu.be/DBZvPPBVbuw?si=k6Rm09fLYPVKJJXV

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

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

r/Unity3D

We are making an incremental bullet hell where you mine cofferoids and become powerful to obliterate greedy SpaceCorp machines. Wishlist now on Steam!
https://redd.it/1jfqmua
@r_Unity3D

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