Change attribute position X

csmyersacsmyersa Member, PRO Posts: 11

Hello hello!

I have an actor that moves from the right to the left. I am trying to create a way that and once it hits x=0 then it reappear at the right of the screen (x=500).

I created a rule which says
When self.position x=0
Change attribute behavior x=500 (far right of my screen)

But it doesnt work. Any ideas why?

I also tried with spawn behavior but it doesnt work either (see second image)


Thank you!

Christina

Comments

  • Two.ETwo.E Member Posts: 599
    edited February 2019

    Hi Christina,

    You will need to use the =< sign. (Equal or less than)

    Reason being, the chances of your actor being at exactly 0 x position is very small when its moving. You can test this for your self by giving the actor a display text behaviour and select the actors X position.

    By including the less than sign (or greater than if going opposite direction), it means the rule is going to activate as soon as it passes 0 x position.

    Hope that helps.

  • csmyersacsmyersa Member, PRO Posts: 11

    thank you very much!!!

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

    Sounds like you are wrapping the actor, if you want every actor to wrap from one edge of the screen to the other you can turn on Wrap X (and Wrap Y) in the scene Attributes as well.

Sign In or Register to comment.