#I can only slide one enemy in platform when both are walking on the platform

1 messages · Page 1 of 1 (latest)

hardy rune
gleaming turret
hardy rune
#

oh reason must be when one of them walks, issliding is true and because other one cant slide

#

I added that because it was starting coroutine over and over again

gleaming turret
#

Yes, so the logic is a bit flawed because you've coded it so only 1 slides at a time.
Theres different ways to solve this, like store which object is currently sliding in a list and remove it after sliding is done.
Or move some of this logic to the enemy script and have each enemy just handle the state themselves

#

Im sure some people would choose one way or the other depending on how strictly they like to structure their game

hardy rune
gleaming turret
#

That might cause you more issues if an enemy starts sliding multiple times

hardy rune
#

platform is not very big so it doesnt slide one more time

gleaming turret
#

If you add more colliders or stuff to the player you might face it, I face this issue a ton because i use ragdolls with like 14 limbs so each one will try to trigger an effect.
I mostly just let the world objects deal with it and store what they're currently affecting in a list

hardy rune