How many of you have Animancer API package experience?
I’m only using Animancer lite so far, and it’s been great not having to deal with my own state machine and the Animancer state machine, but I keep running into an issue. In certain scenarios my end events from a previous state will trigger after the state has exited. I know I have to code for the animation to stop explicitly and clear the event. Is there some special protocols when dealing with end events in Animancer with Finite State Mqchines?
https://redd.it/1ha49ww
@r_Unity3D
I’m only using Animancer lite so far, and it’s been great not having to deal with my own state machine and the Animancer state machine, but I keep running into an issue. In certain scenarios my end events from a previous state will trigger after the state has exited. I know I have to code for the animation to stop explicitly and clear the event. Is there some special protocols when dealing with end events in Animancer with Finite State Mqchines?
https://redd.it/1ha49ww
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Released my first 2D mobile game on Google Play Store.
gameplay footage
Download Now
https://redd.it/1ha88ah
@r_Unity3D
gameplay footage
Download Now
https://redd.it/1ha88ah
@r_Unity3D
Media is too big
VIEW IN TELEGRAM
Created a unique plasma/pollen engine using text symbols. You can ignite it anywhere on the screen. Technically, it's quite simple: Perlin noise shifts upward and controls the gradient descent of symbol positions. As a result, symbols form streams as they move upward. Looks interesting?
https://redd.it/1ha9fvu
@r_Unity3D
https://redd.it/1ha9fvu
@r_Unity3D
Detect object when teleporting past it
I'm making a 2d sidescroller that is essentially turn based with grid movement. When you step off a ledge, you instantly land on the ground rather than falling over time. It enters a while loop that repeatedly decreases your y position by 1 until you are on the ground.
This has caused an issue because hazards and pickups which effect the player when their OnTriggerEnter2D is triggered. But because of the way I'm handling falling, the player essentially teleports through the object and doesn't interact.
I tried checking for the objects using OverlapCollider in the while loop each time the position is changed, but that doesn't seem to be working.
https://redd.it/1ha5jfd
@r_Unity3D
I'm making a 2d sidescroller that is essentially turn based with grid movement. When you step off a ledge, you instantly land on the ground rather than falling over time. It enters a while loop that repeatedly decreases your y position by 1 until you are on the ground.
This has caused an issue because hazards and pickups which effect the player when their OnTriggerEnter2D is triggered. But because of the way I'm handling falling, the player essentially teleports through the object and doesn't interact.
I tried checking for the objects using OverlapCollider in the while loop each time the position is changed, but that doesn't seem to be working.
https://redd.it/1ha5jfd
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Rust Runners Screenshots! What do you think so far? Wishlist on Steam!
https://redd.it/1haf0q4
@r_Unity3D
https://redd.it/1haf0q4
@r_Unity3D
Reddit
From the Unity2D community on Reddit: Rust Runners Screenshots! What do you think so far? Wishlist on Steam!
Explore this post and more from the Unity2D community
Help with collisions
Hi,
New to developing in unity and was wondering if anyone can help me with an issue I have, basically i want a bullet to hit an object and delete it (or at least log its colliding)
I have a bullet class thats get created when the Fire method is called and this works fine, it creates a bullet that moves at the correct speed in the correct direction but for some reason the collision detection isnt working
Ive attached the 2 noscripts as well as images of the inspector for the bullet prefab and Square object (the one i want the bullet to collide with)
At the moment the bullet just passes right through the square when i would expect it to at least log a message
They each have colliders and rigid bodies so im not sure why this is happening
public class Bullet : MonoBehaviour
{
public float lifespan = 3f;
void Start()
{
Destroy(gameObject, lifespan);
}
void OnCollisionEnter2D(Collision2D collision)
{
Debug.Log($"Bullet hit: {collision.gameObject.name}");
// Destroy the object the bullet collided with
Destroy(collision.gameObject);
// Destroy the bullet itself
Destroy(gameObject);
}
}
void FireBullet()
{
// Instantiate the bullet at the spawn point
GameObject bullet = Instantiate(bulletPrefab, bulletSpawnPoint.position, bulletSpawnPoint.rotation);
// Add velocity to the bullet in the direction the spaceship is facing
Rigidbody2D bulletRb = bullet.GetComponent<Rigidbody2D>();
bulletRb.velocity = bulletSpawnPoint.up * bulletSpeed;
}
https://preview.redd.it/vn2y9odqvu5e1.png?width=392&format=png&auto=webp&s=c98df85970ef52dd66dd1e7912a3fbfd6908885c
https://preview.redd.it/o1hs15qzvu5e1.png?width=385&format=png&auto=webp&s=15d9acbc8de04b8edcb96c5dd56fdbc535557db4
https://redd.it/1haevvs
@r_Unity3D
Hi,
New to developing in unity and was wondering if anyone can help me with an issue I have, basically i want a bullet to hit an object and delete it (or at least log its colliding)
I have a bullet class thats get created when the Fire method is called and this works fine, it creates a bullet that moves at the correct speed in the correct direction but for some reason the collision detection isnt working
Ive attached the 2 noscripts as well as images of the inspector for the bullet prefab and Square object (the one i want the bullet to collide with)
At the moment the bullet just passes right through the square when i would expect it to at least log a message
They each have colliders and rigid bodies so im not sure why this is happening
public class Bullet : MonoBehaviour
{
public float lifespan = 3f;
void Start()
{
Destroy(gameObject, lifespan);
}
void OnCollisionEnter2D(Collision2D collision)
{
Debug.Log($"Bullet hit: {collision.gameObject.name}");
// Destroy the object the bullet collided with
Destroy(collision.gameObject);
// Destroy the bullet itself
Destroy(gameObject);
}
}
void FireBullet()
{
// Instantiate the bullet at the spawn point
GameObject bullet = Instantiate(bulletPrefab, bulletSpawnPoint.position, bulletSpawnPoint.rotation);
// Add velocity to the bullet in the direction the spaceship is facing
Rigidbody2D bulletRb = bullet.GetComponent<Rigidbody2D>();
bulletRb.velocity = bulletSpawnPoint.up * bulletSpeed;
}
https://preview.redd.it/vn2y9odqvu5e1.png?width=392&format=png&auto=webp&s=c98df85970ef52dd66dd1e7912a3fbfd6908885c
https://preview.redd.it/o1hs15qzvu5e1.png?width=385&format=png&auto=webp&s=15d9acbc8de04b8edcb96c5dd56fdbc535557db4
https://redd.it/1haevvs
@r_Unity3D
How to disable a rigid body without disabling the collider
So, I have an object that I would like to merge with another object. both objects have colliders and rigid bodies, and I would like to make one of them become a child of the other to connect them. in order to do that, I would like to disable the rigid body of the first so it can become the child of the other, with the ability to enable it on disconnect. the problem is I want the object to still be able to collide as a part of the second object.
If I simply delete the rigid body, it operates as I want it, with the colliders colliding. kinematic is not what I need, and physics layers did not work. problem is simulated just turns off the collider, so that does not work either.
I have been pondering this for close to a week, and found no answer. chat gpt said to maybe create a save state for a rigid body, but that feels ugly, so I would like to know if there is a built in solution that makes this possible.
https://redd.it/1haif2m
@r_Unity3D
So, I have an object that I would like to merge with another object. both objects have colliders and rigid bodies, and I would like to make one of them become a child of the other to connect them. in order to do that, I would like to disable the rigid body of the first so it can become the child of the other, with the ability to enable it on disconnect. the problem is I want the object to still be able to collide as a part of the second object.
If I simply delete the rigid body, it operates as I want it, with the colliders colliding. kinematic is not what I need, and physics layers did not work. problem is simulated just turns off the collider, so that does not work either.
I have been pondering this for close to a week, and found no answer. chat gpt said to maybe create a save state for a rigid body, but that feels ugly, so I would like to know if there is a built in solution that makes this possible.
https://redd.it/1haif2m
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Assignment doubt
I got an assignment where it is mentioned that dont use generative ai, we can identify easily. Can anyone know how they can find it or how can i get rid of it.
https://redd.it/1hahohl
@r_Unity3D
I got an assignment where it is mentioned that dont use generative ai, we can identify easily. Can anyone know how they can find it or how can i get rid of it.
https://redd.it/1hahohl
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
does anyone know what could be causing this?
https://youtu.be/6aunX6d5o5s
https://redd.it/1hamyan
@r_Unity3D
https://youtu.be/6aunX6d5o5s
https://redd.it/1hamyan
@r_Unity3D
YouTube
unity 2d platformer jump issue
Help building a shop system c#
I am running into some trouble with my shop system.
I have a shop manager noscript that opens and closes the shop UI.
I have three shop slots gameobjects each with a shopslotnoscript. This noscript is responsible for randomizing an item noscriptable object and filling the UI with that items data.
When the item is purchased from the shopslotnoscript, I want to send the items data to the players storage slot UI.
I’ve been staring at this for two days and the answer seems obvious, but I am looking for a way to send the shop slot random item data to other noscripts.
Because the shop slot and item storage slot will sometimes be inactive in the game they both have separate managers, a shop manager and a storage manager. So essentially, I’m looking to send the shop slot item data to the managers so that the managers can send it to the proper slot if that makes any sense.
I thought about creating a variable to fill with the purchased item data but bc I want the player to be able to buy multiple items I would then need multiple variables?
Any help or pointing in the right direction would be amazing. Thanks in advance.
https://redd.it/1hamrma
@r_Unity3D
I am running into some trouble with my shop system.
I have a shop manager noscript that opens and closes the shop UI.
I have three shop slots gameobjects each with a shopslotnoscript. This noscript is responsible for randomizing an item noscriptable object and filling the UI with that items data.
When the item is purchased from the shopslotnoscript, I want to send the items data to the players storage slot UI.
I’ve been staring at this for two days and the answer seems obvious, but I am looking for a way to send the shop slot random item data to other noscripts.
Because the shop slot and item storage slot will sometimes be inactive in the game they both have separate managers, a shop manager and a storage manager. So essentially, I’m looking to send the shop slot item data to the managers so that the managers can send it to the proper slot if that makes any sense.
I thought about creating a variable to fill with the purchased item data but bc I want the player to be able to buy multiple items I would then need multiple variables?
Any help or pointing in the right direction would be amazing. Thanks in advance.
https://redd.it/1hamrma
@r_Unity3D
Reddit
From the Unity2D community on Reddit
Explore this post and more from the Unity2D community
Can I use a hand-drawn map?
Hello! I'm new to making games, and I was making a 2D Pixel game when I ran into a bit of a fork in the road. When I started, I thought I should get most of the design aspects of the game (Sprites, backgrounds, etc) out of the way first before I go onto Unity to code.
When I looked at different methods of implementing the map, however, almost every tutorial used Tilemaps to create the map on Unity. I, however, drew up the map beforehand on a pixel art website (Separating the objects so I can add collision later) and now I'm wondering which method is better/more efficient. Is ok for me to use hand-drawn maps or should I use tilemaps and construct my maps on Unity?
Each location in my game is relatively small so I don't mind putting in the effort to hand-draw them all, but in terms of implementing them in Unity, I want to know if my method is ok, how I should go about implementing my map and if it will lead to any problems. Thank you!
https://redd.it/1haogbg
@r_Unity3D
Hello! I'm new to making games, and I was making a 2D Pixel game when I ran into a bit of a fork in the road. When I started, I thought I should get most of the design aspects of the game (Sprites, backgrounds, etc) out of the way first before I go onto Unity to code.
When I looked at different methods of implementing the map, however, almost every tutorial used Tilemaps to create the map on Unity. I, however, drew up the map beforehand on a pixel art website (Separating the objects so I can add collision later) and now I'm wondering which method is better/more efficient. Is ok for me to use hand-drawn maps or should I use tilemaps and construct my maps on Unity?
Each location in my game is relatively small so I don't mind putting in the effort to hand-draw them all, but in terms of implementing them in Unity, I want to know if my method is ok, how I should go about implementing my map and if it will lead to any problems. Thank you!
https://redd.it/1haogbg
@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
Challenging but worth it! Used Unity to integrate the eBay API and made a one-week jam game where you guess eBay lot prices online with friends or solo.
https://redd.it/1hag1gb
@r_Unity3D
https://redd.it/1hag1gb
@r_Unity3D