Actor Speed Question

rhysdaramborhysdarambo Member, PRO Posts: 33

Hi, I'm rather quite stuck,

Say I have two actors named "first" and "second" - each 100x100px.
Using iPhone scene btw, 320x568px.

I'm trying to get "first" actor to go to disappear off the left off the screen (i.e x position=-50px) while at the same time getting actor "second" to go to the bottom of the screen (i.e y position=-50px). But heres the thing, I need them to both go disappear off the screen at the same time regardless of their position.

How would I do this??

Any help would be really great! Really looking for some answers.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Use interpolate and interpolate either their X or Y position to -50.

  • rhysdaramborhysdarambo Member, PRO Posts: 33

    Hi Socks.

    Perhaps I didn't explain my self well enough. I'll make it a bit simpler.

    Say I have two actors in an iPhone scene.

    I want both actors to move off screen at** exactly the same time** by moving down. Now this is easy to do when both actors are at the same height e.g using the move or interpolate behaviour and setting a constant speed. But how about when actor one and actor two are at totally different heights? Say the first actor is 10px above the bottom and the second actor is 100px above the bottom. The first actor would have to move extremely slow while the second actor would move really fast, like 900% faster than the first actors speed. I am so close to grasping the concept but there's something I am just missing!

    Please Help!..

  • SocksSocks London, UK.Member Posts: 12,822

    @rhysdarambo said:
    Hi Socks.

    Perhaps I didn't explain my self well enough. I'll make it a bit simpler.

    Say I have two actors in an iPhone scene.

    I want both actors to move off screen at** exactly the same time** by moving down. Now this is easy to do when both actors are at the same height e.g using the move or interpolate behaviour and setting a constant speed. But how about when actor one and actor two are at totally different heights? Say the first actor is 10px above the bottom and the second actor is 100px above the bottom. The first actor would have to move extremely slow while the second actor would move really fast, like 900% faster than the first actors speed. I am so close to grasping the concept but there's something I am just missing!

    Please Help!..

    Like I say, use interpolate and interpolate either their X or Y position to -50

  • LumpAppsLumpApps Member Posts: 2,881

    What @socks says. Or if it is any help. Actors speed is pixel per second. So if you put in your move behaviour 270 degrees for down and and a speed of self.position.y/A where a is A number same for both actors. But I am pretty sure using interpolate is more accurate.

  • SocksSocks London, UK.Member Posts: 12,822

    @LumpApps said:
    What socks says. Or if it is any help. Actors speed is pixel per second. So if you put in your move behaviour 270 degrees for down and and a speed of self.position.y/A where a is A number same for both actors. But I am pretty sure using interpolate is more accurate.

    Far too clever and complicated ! :)

    Just use interpolate and enter whatever time value you want.

    If you want the actor to take 2 seconds to get the the edge of the screen then just enter 2 !!! It really is as simple as that !! It doesn't matter where the actor is, 2 seconds is two seconds !!! Do you think I've used enough exclamation marks yet !!!!?!!!!!

  • LumpAppsLumpApps Member Posts: 2,881

    No, I'll ad some more: use interpolate!!!!!!!!!!!!!!!!

  • SocksSocks London, UK.Member Posts: 12,822

    @LumpApps said:
    No, I'll ad some more: use interpolate!!!!!!!!!!!!!!!!

    :)

    Here you go . . .

  • LumpAppsLumpApps Member Posts: 2,881
    edited April 2014

    And now make them stop halfway the time with a button and then continue after pressing the button again. That's why I thought of another method. Not dissing you but always thinking a few steps ahead. B)

  • SocksSocks London, UK.Member Posts: 12,822

    @LumpApps said:
    And now make them stop halfway the time with a button and then continue after pressing the button again. That's why I thought of another method. Not dissing you but always thinking a few steps ahead. B)

    I'm always thinking one Flap ahead.

  • LumpAppsLumpApps Member Posts: 2,881

    You dirty bird

  • rhysdaramborhysdarambo Member, PRO Posts: 33

    I just clicked @socks haha I was going of on all sorts of tangents with attributes and formulas. The easiest solution is always the best but usually overseen. Thanks for your input too @Lumpapps.

    Cheers.

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2014

    @rhysdarambo said:
    I just clicked socks haha I was going of on all sorts of tangents with attributes and formulas. The easiest solution is always the best but usually overseen. Thanks for your input too Lumpapps.

    Cheers.

    Yeah, I do think people can overthink a lot of these things !

Sign In or Register to comment.