#Show the !code of both scripts

1 messages · Page 1 of 1 (latest)

meager palm
#

Nothing here is particularly slow. Where are you seeing that these are the cause of the slowdown

coarse river
#

the objects are the cause of the slowdown because when i turn off the parent and exclude them from the scene it runs fine

meager palm
#

Is there anything on the parent

coarse river
#

no, just the transform

meager palm
#

How complicated are the polygon colliders

coarse river
#

i'd show you but in the process of getting help from discord unity went:

sterile mist
#

lol what is happening here

private void OnCollisionEnter2D(Collision2D collisionData)
    {
        OnTriggerEnter2D(collisionData.collider);
    }```
coarse river
#

i have no clue

#

this stuff is still from the playground URP,

meager palm
coarse river
coarse river
meager palm
coarse river
#

wait no it's just black and white

meager palm
coarse river
#

also no

#

well fixed the scene color by restoring the layout, but the objects still have significant demand

coarse river
#

so theres like 7 objects with kindof complicated delauney mesh colliders, and scripts to follow my player and that's enough to halt my game

#

the sprites themselves don't even seem overly detailed

meager palm
#

You should probably just use a box collider

coarse river
#

alr

#

wow that is a massive difference

#

thanks

#

do you know why the meshes are so much more expensive?

meager palm
#

Because a box has four vertices

meager palm
coarse river
#

true

#

kind of sucks that the colliders calculate the entire collider instead of using having a simple stopgap collider that determines if they are able to collide before using the complicated one

#

like use a radius or box or pill or something by default and then go throug the nitty gritty when objects are really close

#

anyways thanks

#

private void OnCollisionEnter2D(Collision2D collisionData)
{
OnTriggerEnter2D(collisionData.collider);
}

private void OnTriggerEnter2D(Collider2D colliderData)
{

the oncollision method isn't working, what do i need the collider set up as to trigger the collision enter or trigger enter methods?