From your Vampire Survivors Unity Tutorial, the current interaction is that when the player comes into contact with the enemy. They push you. I want to remove this and I tried updating the EnemyStats.cs to comment out the knockback as well tried updating the knockback force. Both does not work.
I cannot find the code for knockback as well in the PlayerStats.cs
The only instances of knockback is in EnemyStats.cs and EnemyMovement.cs
Hi Logique, thanks for dropping in to the stream just now. If I had known your question was simple I would’ve answered it in the stream. My bad.
The pushing is not caused by damage knockback. It is caused because both the enemies and the player have a solid collider. You need to disable the solid collider on the player by checking its Is Trigger attribute, but this will cause the enemy to be unable to damage the player, because the damage only happens on a collision.
To restore enemies damaging the player, you need to the following to EnemyStats.cs to get triggers to register damage:
void OnTriggerStay2D(Collider2D col)
//Reference the script from the collided collider and deal damage using TakeDamage()
PlayerStats player = col.gameObject.GetComponen<PlayerStats>();
player.TakeDamage(currentDamage); // Make sure to use currentDamage instead of weaponData.Damage in case any damage multipliers in the future