Couldn't see a dedicated Footstepper Board so I've written here. Hope it is fine.
I've successfully added Footstepper for my characters in 2D mode. Now I'd like use it on my projectiles.
I've look at the Demo scene. Other than tha player character, the "CratePink" object shows how to play audio using raycast2D and Footstep Materials.
So I set up my projectile looking at that and called Land(-1) on its Footstepper component when Unity calls OnTriggerEnter2D.
but I'm getting this
Coroutine couldn't be started because the the game object '_machineGunProjectile-0' is inactive!
GamingIsLove.Footsteps.Footstepper:PlayFootstep(Transform, Single, FootstepType) (at Assets/Footstepper/Scripts/Footstepper.cs:387)
GamingIsLove.Footsteps.Footstepper:Land(Int32) (at Assets/Footstepper/Scripts/Footstepper.cs:843)
CallFootstepperonCollision:OnTriggerEnter2D(Collider2D) (at Assets/CallFootstepperonCollision.cs:16)
It is probably because projectiles are being pooled.
So I tried footstepper.SetGrounded(true);
It seems to work but not all the projectile hits register.
I don't know how to approach this.
I don't think I can change the pooled projectiles.
So my question is:
- How to setup a projectile to play Footstepper when its is pooled?
-Is it OK to use SetGrounded on such a case?
-Is it an overkill to use "Footstepper" component for a projectile? Would it be better to make a new component dedicated for fast moving physics objects?
Thanks for the help.