magnet game

I want to create the following magnet game:

The aim of the game is to put the metal piece on the table.

The magnet is hanging on a rope. First, I need to bring the magnet to a position, where the magnet is directly above the metal piece. For the navigation, I want to use the arrows for the vertical position and the slider vor the horizontal position ( If it is too difficult to use a slider, I can also use two other arrows for the vertical navigation). Vertically, If I stop press on of the arrows (press = hover over arrows), the magent should remain in the actual position (like a claw machine).

If the magnet is directly above the metal and the user press the green button, the metal should be attracted by the magent. Now you have to move the magnet above the table by again, using the navigation objects arrows and slider. After the magent is above the table, press the red button and the metal is falling on the table and you will win the game.

One more feature if possible: If the magnet is connected with the metal and you want to move them to the table and you press the red button at any other position  except directly above the table, you will just get a security warning:"do not press the red button of there is a metal under the magent" but can continue moving the magnet with the metal peace after clicking hide warning.

Every help is highly appreciated.



13 Replies
Ned Whiteley

Hi Fiedel,

Here is something to get you going.

Each time you click on an arrow, the magnet will move left / right 23px or up / down 25px. If you keep the button pressed down, the magnet will keep moving until you release the button. If you use variables to track the horizontal and vertical positions of the magnet, you can restrict the movement to ensure the magnet always remains inside the box and also determine when it is safe to pick up and drop the metal object.

If you have any problems, just ask for more help here.

Fiedel Laurenz

Hi Ned,

I'm sorry that I didn't write earlier but I was so busy the last days. Thank you very much for your help!!! 

I created a modified example (slide 2). What I want to do is to integrate a slider to move the object horizontally so I just use two arrows for the vertical position.

I have the following questions:

When I move the object vertically by clicking on the arrows, the movement doesn't look fluently. Do I may have to change any motion path options? (I want the object to move like the one in slide 1). The movement on the horizontal line is ok though.

Also when I cklick the arrows very quick again and again, the variable doesn't count exactly so the whole game is going to become a nightmare...Do you know how to handle this problem? Is there any option or do I have to write in the instruction that the user shouldn't click the arrows too fast?

Thanks in advance



Ned Whiteley

Hi Fiedel,

Solving the fluent motion of your magnet in the vertical position is simple. When an object moves along a motion path, you can control if the entire movement is at the same speed or if the start and finish sections are slower. The default setting is where the start and finish are slower than the middle portion and so, when your magnet is moving, it moves slowly at the start, then speeds up, slows down again and then speeds up again and repeats this as long as you hold the button down. As a result you get the jerking motion that you currently see on slide 2.

To change this setting, select each motion path in turn and then select the Path Options tab from the menu, select Direction from the Easing section and then select None. This will turn off any easing (i.e. slowing down) at the start and finish of the motion path. Once you have done this for both motion paths, your slide should be working OK.

With regards to the rapid pressing of the button, I can't yet find a solution for that and so I would suggest that your instructions simply tell the user to hold the arrow keys down until the magnet is at the right height. Although they may need to select the arrow key again for fine tuning, it is unlikely that they will press it several times rapidly.

As far as your instructions are concerned, I would recommend putting them on a separate slide in a separate Storyline scene, that you call up from a button as a lightbox slide. This is where the additional information is displayed on top of your current slide and can be closed down by selecting the 'X' in the top right corner. When you close it down, you are then returned to your game slide and ready to continue.

Fiedel Laurenz

Hi Owen, I used your dial to make the magnet move up and down. But I still have the problem that if you push the dial too fast the system does not count the variable correctly so sometimes the magnet is out of the field (see image).

Do you have any idea what I have to do? I saw at your claw game example that you don't have this problem....

Thanks in advance :)


It has been a long time since I made that claw game but ... I vaguely remember having a similar issue.  To resolve it, I believe I used additional T/F "Activity Tracking" variables called something like HorizontalActive and VerticalActive.  I also tracked position to set movement boundaries.  The logic goes something like this:
Move "object" on "appropriate animation" when "triggering even happens" if "Activity Tracking Variable" is equal to False AND position is Greater Than "Left Boundary" for left movement. For right movement, the last part would be AND position is Less than "Right Boundary".

Deactivate your trigger while animations run:
Set "Activity Tracking Variable" = to True when "triggering event happens".

Add or subtract 1 to your position tracking variable as your left and right animations complete.
Also, set your "Activity Tracking Variable" back to false at the end of each animation so it can once again be triggered.

Repeat all of this for your vertical animations.  See it here: LINK

Fiedel Laurenz

Hi Owen,

Thanks for your help. I added a T/F Tracking variable like you said. Now it works, that it doesn't matter how fast you click on the buttons, the magnet remains in the zone. 

I would also like that if the learner clicks e.g. on the up arrow, that the arrow change his state and the magnet moves as long as you keep click the mouse. Do you know which additional trigger I have to add?



  1. I changed the trigger on both arrows from "when clicked" to "when state = down" to trigger the animations.
  2. I added the condition to change your animation active variable to false when either animation completes ONLY if the button is NOT in the down state or if the vertical position IS equal to one of your limits.
  3. I added 2 triggers causing each animation to repeat upon the completion of itself as long as active is equal to true and you aren't at your motion limits.

See attached updated file.