Help with 2D animation script

Ok so i need to figure out how to play certain animations when the “player” interacts with rigid bodies with a specific tag i think i might know how to do this but i need help becuase im about as good at coding as a dead cat.

somebody please

Hi @Orange_Test_Room,

At what part are you stuck? On playing the animation or detecting the collision?

For the latter here is a good tutorial:

For the animation you can prepare the sprite using the sprite editor:

And to have it start playing in code you can use the sprite component API:

ii having trouble with the tag collision detection

heres an example if you are using collision start

script.prototype.collision = function(result){
    if(result.other.tags.has("im a tag")){
       console.log( + " has the tag im a tag")

ok i tried something like this

use raycasting instead if thats so

that might work i do already ave a script that can detect your right and left sides but im not quite sure how to attach the sprite play script'clip');