にやられた

was hit by

→ に
phrase Very common #704
was hit by に marks the person or thing responsible. やられた often means being victimized, defeated, or badly affected by someone or something.
JA: 風邪にやられた。
EN: I was knocked out by a cold.

暑さにやられた。

The heat got to me.

父はバスの中で財布をすりにやられた。

My father had his wallet stolen by a pickpocket on the bus.

体育のアゴにやられたんでしょ~

You got beaten by the gym teacher, didn’t you?

— AKIRA (1988)

私はすりにやられた。

I was pickpocketed.

僕はバスの中でスリにやられた。

I was pickpocketed on the bus.

夏の暑さにやられたよ。

The summer heat really got to me.