Actor going going back and forth between two objects

csmyersacsmyersa Member, PRO Posts: 11

Hello

I am trying to have an actor going left and right between two walls. It's an obstacle so it should keep going left and right.

Once the actor touches the right wall it goes left and when it touches the left wall it goes right.

Any ideas?

Thanks

Comments

  • AlkaPPAlkaPP Member, PRO Posts: 194
    edited April 2019

    @csmyersa hope it helps

  • bob loblawbob loblaw Member, PRO Posts: 793

    @csmyersa said:
    Hello

    I am trying to have an actor going left and right between two walls. It's an obstacle so it should keep going left and right.

    Once the actor touches the right wall it goes left and when it touches the left wall it goes right.

    Any ideas?

    Thanks

    maybe a rule that says when the actor collides with the wall, change linear velocity x to linear velocity x *-1. just make sure that the walls are different boundary actors to floors and platforms if you use them.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    This tutorial might help:

Sign In or Register to comment.