#weird collider problem top down 2d

1 messages ยท Page 1 of 1 (latest)

meager marsh
#

how would i get the player to stop moving using that

serene raven
#

u would just not call it..

#

or set its position to itself.. (which would probably act the same way)

meager marsh
#

but when i let go it starts sliding

serene raven
#

if(giving input) -> rb.movepos else -> //blank

#

really?

#

do u not have any friction

#

when not moving it should come to a stop on its own.

meager marsh
#

i have friction i think its because of some messy code

serene raven
#

well i say friction.. but i meant drag..

meager marsh
#

i have it so the player only moves after a small buffer time where the player has to hold down the key to actually move

serene raven
#

drag should slow it down to a stop

meager marsh
#

oh

serene raven
#

ahh, yea i think ur code could be improved.. and why ur having some of these issues..

#

i dont work in 2D to be fair.

meager marsh
#

i changed the drag from 0 to 0.05 and it works fine

serene raven
#

but 3D is similar enough..

meager marsh
#

the stopping i mean

serene raven
#

ohh yea!

#

thats a step forward hehe

meager marsh
#

i must have accidentally set it to 0 at some point lol

serene raven
#

so.. now if ur not calling rb.moveposition (it shuld come to a rest by itself)

#

unless being pushed by the enemy or w/.e

meager marsh
#

the enemy does this weird thing

#

the objects colide and the enemy stops for a sec and then phases through the collider, but not all the way thru

#

it phases mostly through, but then actually starts pushing it as normal

#

weird collider problem top down 2d

serene raven
#

you never changed the detection modes like me and digiholic suggested

meager marsh
#

i did

#

i tried it and then changed it back

#

to try it discrete as well

meager marsh
#

i have no idea what to do

#

wait

#

wait wait wait wait

#

i think i know

#

it might be the single dumbest thing ever

#

oh my god i was right

#

what the actual heck

meager marsh
#

and in that game i wanted the character to move through its enemies

#

so i had the couroutine ignore layer collisions while it was active so that the enemy didn't deal damage while the player was invincible

#

and it worked on this project too and thats the ENTIRE reason the enemy wasn't colliding properly

#

it wasnt the rb.velocity, it wasnt continuous vs discrete or any of that ๐Ÿ˜ญ

serene raven
#

omg

#

lmao, that'd do it

meager marsh
#

uh huh

#

i feel dead inside now

#

i spent maybe 2 hours working on this

serene raven
#

better to catch it now tho..

#

coulda been tomorrow or something ๐Ÿ˜„

#

just use it as a learning experience.. when codes not doing what its supposed to be doing.. its probably other code ur not lookin at changing things around w/o ur knowing

meager marsh
#

yup

#

note to self

#

look at EVERYTHIGN

serene raven
#

glad u got it figured out

#

๐Ÿ€

meager marsh
#

thanks for your help bro ๐Ÿ‘๐Ÿพ

#

ok now whenever i get pushed by the enemy, move out of the way, and then stop moving it slides me

#

oh i fixed that and now something else is wrong ๐Ÿ˜ญ