Can i make two scripts that have same name.

Hello guys

I’m not good at english and unity beginner.

I hope you can understand my question.

There are two prefabs (hunter, warrior)

‘Hunter’ has 'attack’scripts
Also ‘warrior’ has 'attack’scripts too

Each scripts has different variables but 'damage

I want to use them by 'getComponent ().damage in the 'OntriggerEnter2D

Will it work saperately??

Hello! I don’t think that you can make 2 scripts with the same name, in fact I’m pretty sure. However you can use one attack script on two different prefabs with different values.

Hope i could help!