You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Its kind of a weird issue, I have animated sprite component which plays for animations based on key events, like I am passing which key will play which animation like for one compents its "AWSD" while for another it is "Arrow keys" so two sprites has same four animation but only wjll play on different key events also I am sending img as prop too so I can have different characters as sprite and it works fine in that case when imgs are different only issue is that when I pass the same img to both components they start reacting to the key events of another sprite. I am not sure if I am explaining it properly.
I made a sandbox if you see I have two animated sprite components in canvas both have different key codes for playing animation on different keys event and passing img as prop too. if you use same img for both components they play animation on other's key event and if you pass another img it works properly (use another img "sss.png" from public)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Its kind of a weird issue, I have animated sprite component which plays for animations based on key events, like I am passing which key will play which animation like for one compents its "AWSD" while for another it is "Arrow keys" so two sprites has same four animation but only wjll play on different key events also I am sending img as prop too so I can have different characters as sprite and it works fine in that case when imgs are different only issue is that when I pass the same img to both components they start reacting to the key events of another sprite. I am not sure if I am explaining it properly.
I made a sandbox if you see I have two animated sprite components in canvas both have different key codes for playing animation on different keys event and passing img as prop too. if you use same img for both components they play animation on other's key event and if you pass another img it works properly (use another img "sss.png" from public)
Beta Was this translation helpful? Give feedback.
All reactions