#ok

1 messages · Page 1 of 1 (latest)

tight bay
#

here is your thread. please post here.

limpid nacelle
#

as i said, i modified the rigid body, not the collision

#

so they dont rigid'd each other

twilit sapphire
limpid nacelle
#

they collide

twilit sapphire
#

Yes they collide, you didn't properly ignore

limpid nacelle
#

yeah, thats the idea

twilit sapphire
#

the layer the collider is on is the important layer

#

so you have effectively done nothing

limpid nacelle
#

yeah, but i modifie the rigid layer

#

for make them dont touch

#

wich would make them, dont CRASH

#

and this is good. My issue is, if this might give me trouble in the future

#

or nah

twilit sapphire
#

The only reason they're not crashing is because one of your colliders is a trigger

limpid nacelle
#

say what again

#

how

#

i never turned them into a trigger

twilit sapphire
#

you checked the Is Trigger box

#

presumably

limpid nacelle
#

a h

#

i should have forgot

#

wait what, where?

#

now im checking and im not finding it

twilit sapphire
#

i have no idea, presumably on one of the colliders

#

You haven't shown enough info here to make a full assessment of how things are set up

#

YOu said they are "triggering"

#

you need to explain what you mean by that - which I asked you a while ago

limpid nacelle
limpid nacelle
#

that's simple

twilit sapphire
#

how

#

why

#

do you have code that does that?

#

Show the code

limpid nacelle
#

i do

#

let me show u

twilit sapphire
#

How does it work?

limpid nacelle
#
{
    Vector2 MacheteRange = new Vector2(attackRange, attackRange);
    Collider2D hitEnemy = Physics2D.OverlapBox(machetepos.transform.position, MacheteRange, 0f, valeria);

    if (hitEnemy != null)
    {
        if (hitEnemy.TryGetComponent(out ValeriaController enemy))
        {
            enemy.TakeDamage(meleeDamage);
            proximoAtaque = Time.time + cooldownAtaque; // Se establece el cooldown para el próximo ataque
        }
    }
}```

first i did the player's meele using overlapping, and due thats was the only way i knew how to do it, i also did the enemy do that aswell
twilit sapphire
limpid nacelle
#

:3 clever or idiotic?

twilit sapphire
#

that's why it's not affected

limpid nacelle
twilit sapphire
#

Physics2D.OverlapBox is not related to any Rigidbody

limpid nacelle
#

i know...

twilit sapphire
#

it doesn't know or care about your rigidbody layer ignoring

limpid nacelle
#

aaaaaaaaaaaaaaaaaaaaaa

#

ofc

#

so this mean if i make it need it

#

im fuck'd

#

unless i check the trigger button

twilit sapphire
#

IDK what you mean by that

limpid nacelle
#

they dont hurt each other

#

that i mean

#

in other words, now i get how this works

#

thanks

twilit sapphire
#

This is one way to do this.
Another way would be to have a second collider which is a trigger

#

on a separate layer

limpid nacelle
#

interesting

#

like, a child?

twilit sapphire
#

yes

limpid nacelle
#

good