Actor movements up and down

I have actors that loop up and down. I have them placed in a straight line so that they move up and down at the same time. However after a few loops, some actors are slightly ahead of the others although they are supposed to go in a straight line. All of them have friction and density set to 0 and bounciness set to 1. I am using the velocity rule as i want them to hit the wall and move the opposite direction.
I saw the sin,cos method but i could not figure a way to make them hit the wall and then bounce back. Any ideas on how to constrain them into moving with others?

Comments

  • grimtoothgrimtooth Member Posts: 69
    if the actors are not required to move (other than up and down) or to interact with any other actors, then the sin method is really exactly what you want...

    here is a template I made while practicing with the technique
    http://yadi.sk/d/I3IxuCOT5t38e
    it has examples of a moving sine wave, stationary X, Stationary Y, Circles, Ovals, and a moving circling corkscrew kind of thing too

  • PBEmpirePBEmpire Member Posts: 676
    @grimtooth Really? I did not know that..
  • grimtoothgrimtooth Member Posts: 69
    wow, I'm sorry but I have to ask since I can't hear you or see facial expressions...

    were you being sarcastic there?

    also forgot to mention, if you were to constrain one actors self.time to a global, then you could have all of them reference it in the sine equation and they would be perfectly aligned at all times regardless of lag or spawn order etc.
  • -Timo--Timo- Member Posts: 2,313
    is the loop behavior only for mac? because I dont have the behavior on windows...
  • grimtoothgrimtooth Member Posts: 69
    He is speaking figuratively about making the actors loop. Not specifically about using a behavior named loop
  • PBEmpirePBEmpire Member Posts: 676
    @grimtooth i really did not know that! :D
    I saw one of the sine template and it was something i would like to have but i could not find a way to make the actor collide into a wall and go the opposite way as in my game, the walls can move if a certain action takes place.
  • grimtoothgrimtooth Member Posts: 69
    ahh, see I didn't know that the walls could move...

    Idea #2... take the physics off of all but the first actor, then constrain the rest of the actors to the first ones self.y through a global attribute?
  • PBEmpirePBEmpire Member Posts: 676
    @grimtooth i meant i did not know i could use the sine method for this not that wall could move
  • PBEmpirePBEmpire Member Posts: 676
    How do you open the file? The link you posted above?
  • PBEmpirePBEmpire Member Posts: 676
    https://docs.google.com/file/d/0BwPB9yLZusN8d1FNR3Zjc2pxYmM/edit
    Here is the link to my problem.. Anyone can figure out what is causing this?
  • FajlajpFajlajp Member Posts: 666
    Hi, I´ve now made a demo for it in the thread "demos for everyone"
    I didn´t implement it dirrectly into the project because I wanted other people also to use the technique. Head over to it :)
    //Fajlajp
  • PBEmpirePBEmpire Member Posts: 676
    @Fajlajp Awesome! Thanks!
Sign In or Register to comment.