Changing Movable Property

MarcusOMarcusO Member Posts: 147
edited November -1 in Working with GS (Mac)
Hi All,
Can anybody please tell me how to change the movable attribute for an actor so that a movable object becomes immovable when i condition is met?
I have a object that moves so the movable attribute is unchecked. I want to make it unmovable or have this checked so that the object become unmovable again.

Thanks and Cheers.
M

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    that is one attribute that cannot be changed once the actor loads. You will have to use something like constraining the x and y positions when the condition is met.
  • MarcusOMarcusO Member Posts: 147
    Thanks tenrdrmer :)
    P.S Have u seen tshirt around?
  • carlosacj36carlosacj36 Member Posts: 54
    i test all of this

    constraining dont function
    changin attribute velocity dont function

    only thing, when your rule be true, destroy the actor and spawn new one in tha same place, but not movable.

    hope that helps.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    carlosacj36 said:
    i test all of this

    constraining dont function
    changin attribute velocity dont function

    only thing, when your rule be true, destroy the actor and spawn new one in tha same place, but not movable.

    hope that helps.

    Constraining does work you must have done something incorrectly
  • MarcusOMarcusO Member Posts: 147
    John, I tried contraiinst and it didnt work. Maybe i must be doing something wrong as well :(
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Do this. Make 1 interger game attribute call it moveOff and set it to 0 and make 2 self real attributes in the object called stopX and stopY(you can name them whatever you want)

    Have a rule in the object when attribute moveOff=1
    -change attribute self.stopX to self.position.x
    -change attribute self.stopY to self.position.y
    -constrain attribute self.position.x to self.stop.x
    -constrain attribute self.position.y to self.stop.y

    Then whenever you want the object to be unmoveable change attribute moveOff to 1. Then change it to 0 when you want it to move againn
Sign In or Register to comment.