Actor moving from left to right and right to left

sebmacflysebmacfly Member Posts: 1,018
edited November -1 in Working with GS (Mac)
Hi! :)

I want to do an accelerate behavior on a actor...
That actor have to move from right to left, and left to right, etc etc etc

Thanks

Comments

  • sebmacflysebmacfly Member Posts: 1,018
    Anybody can help me please?

    Thank you
  • beefy_clyrobeefy_clyro Member Posts: 5,394
  • sebmacflysebmacfly Member Posts: 1,018
    Thanks Beefy...
    When my first actor hit the second actor (who are moving) i don't want to restitute my movement on that second actor... I don't know if i explain right... :s
  • sebmacflysebmacfly Member Posts: 1,018
    OMG, my moving actor is going up and rotate when i hurt it... i don't want that... and if i make it unmovable, he don't move at all... what i have to do??
  • design219design219 Member Posts: 2,273
    Make a duplicate actor with no behaviors, then destroy your first actor and spawn the new actor when your first actor is hurt. There are probably other ways.

    The Support section of this site has many good resources to figure out how these things work. Also, taking the template games and seeing how they work will help you a lot. I would suggest saving your forum questions until you have exhausted the support resources, or otherwise you might lose a little good will with too many questions for simple things. Help is here if you are truly stuck.

    Good luck!
  • sebmacflysebmacfly Member Posts: 1,018
    Ok thank you, sorry for that
  • sebmacflysebmacfly Member Posts: 1,018
    I searched for hours and i can't make it working... when i hit the second actor, he's going out of his moving path...
  • firemaplegamesfiremaplegames Member Posts: 3,211
    you need to Constrain the X or Y value of an Actor if you don't want them to move freely.
  • sebmacflysebmacfly Member Posts: 1,018
    With the Constrain Attribute?
    So i have to Constrain atribute Self.Position.X to Self.Position.X??

    Thanks
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Well, no, that wouldn't work.

    You would need to Constrain the Actor's self.Position.X to a value, like 160.

    You can set it up with an Attribute, like this:

    Create a new Attribute in the Actor called myX (real)

    Then:

    Change Attribute
    self.myX to self.Position.X

    Constrain Attribute
    self.Position.X To: self.myX

    Hope this helps!
    Joe
  • sebmacflysebmacfly Member Posts: 1,018
    Thanks, i'll try that
  • sebmacflysebmacfly Member Posts: 1,018
    i added that in the actor.. but now he don't move at all...
  • firemaplegamesfiremaplegames Member Posts: 3,211
    I see. If the Actor is moving Left to Right, you need to constrain the Y value.

    So:

    Create a new Attribute in the Actor called myY (real)

    Then:

    Change Attribute
    self.myY to self.Position.Y

    Constrain Attribute
    self.Position.Y To: self.myY

    Hope this helps!
    Joe
  • sebmacflysebmacfly Member Posts: 1,018
    Almost work... my ball stop that actor and he go to the other way, he don't continue on his path...
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Try playing with the Density of the Actor. Make the moving one 1000 so the other one cannot push him around.
  • sebmacflysebmacfly Member Posts: 1,018
    Yeah man! Very good, now it's ok! Good tips

    Thank you very much!
Sign In or Register to comment.