I want to know how to efficiently code a clip so that it triggers a timeline move on overlap with another object.
The scenario is a game wherein an animated character is moving on the canvas and you bring it to a goal state, via keyboard input. Something like a “mouse” being meant to find a “cheese” and then it says “you win” or goes to another board.
I’ve been able to execute this idea in a sub-optimal way with a onmouse enter, but wherein, the animated clip had been blocking the mouse, so by either having the animation dodge the mouse center or skip frames I can get it to “kind of work”. Still, li’d like to use keyboard controls,too.
I’ve looked up some javascript suggestions that involve the math of computing the distance between the center of the objects, but that seems like overkill.
I’m wondering if there is a simple command like, “if objectA intersects objectB then, goto…”