locked
Animation suggestion requred RRS feed

  • Question

  • Hi,

    If you have a moving UIElement on screen and you would like to make another object follow the first one using Storyboard.  How would you go about that ?

    I tried to change the To of both DoubleAnimation X and Y to get the TranslateTransform of the first object in a Timer but the second object doesn't move.  In fact if I start the app making the first object not moving then the second object moves all right but as soon as the first object moves which changes the DoubleAnimation X and Y of the second constantly in the timer then it doesn't move anymore until the first object stops.

    Friday, January 3, 2014 12:56 PM

Answers

  • I did change my strategy and used the main Timer to guide projectiles toward the ship rather than using Storyboard in each projectile object.

    • Marked as answer by GearWorld Tuesday, January 7, 2014 5:16 PM
    Tuesday, January 7, 2014 5:16 PM

All replies

  • If I don't move the ship, the projectile is on course all right but if I move the ship which at the same time changes the DoubleAnimations To property of the projectile it doesn't do it until I stop the ship but the coordinates at the top are all right and the projectile should change course according to the position of the ship.

    I don't know what I'm missing.



    • Edited by GearWorld Sunday, August 3, 2014 10:47 AM
    Friday, January 3, 2014 12:59 PM
  • As of now,  I see that the StoryBoard animation is all right, it's just the visual not following the animation because I added a marker on the world to identify the position and the marker follows the projectile trajectory all right so it's really the visual of the projectile not following the storyboard and yet the storyboard is IN this projectile object and is attached to it.  Here's a video showing the marker movement.

    http://sdrv.ms/1crgmnV

    Friday, January 3, 2014 2:57 PM
  • I did change my strategy and used the main Timer to guide projectiles toward the ship rather than using Storyboard in each projectile object.

    • Marked as answer by GearWorld Tuesday, January 7, 2014 5:16 PM
    Tuesday, January 7, 2014 5:16 PM