If touch is pressed change self.physics.movable to true??? [Problem]

EIGHTHSINEIGHTHSIN Member Posts: 132
edited July 2012 in Working with GS (Mac)
Hey Forum,

I am having some difficulties, with something I thought would have been fairly straight forward...

I have an actor that has its self.physics.movable attribute set to false. I would like to enable this on touch, so I have,

If touch is pressed, change self.physics.movable to true

and another rule that says,

If self.physics.movable is true accelerate 270degrees relative to scene by a magnitude of 1000

This does not seem to work, is this a problem with gamesalad or is this action not possible?

Thanks,

EI8HTHSIN

Best Answer

  • expired_012expired_012 Posts: 1,802
    edited July 2012 Accepted Answer
    You can't change the self.movable attribute while the game is running as far as I know. Ex. If you have self.physics.movable set to false it will stay that way even if you tell it to turn true when touched.

Answers

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Yeah basically all the physics attributes cannot be changed at runtime.

    Cheers
  • guillefaceguilleface Member Posts: 1,014
    you do can but nothing will happened, i don't know why game salad allow you to change movable if it won't work, i waste many hours trying to find out why my actor was not moving, i had my actor to display movable, so in the beginning was displaying False, so i added a rule, when touch change self.movable to true, and the display attribute changed to True.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited July 2012
    @guilleface, I'm sorry you found it a frustrating experience and didn't realize that that attribute couldn't be changed during runtime.

    You can create the same conditions by creating a boolean (e.g. self.canMove) and then changing the value when needed and also creating a rule that checks the value of the boolean to allow/disallow movement.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • EIGHTHSINEIGHTHSIN Member Posts: 132
    Cheers for the swift reply guys, it's a shame you cannot do this action, but like @tatiang mentioned there are ways around this, however they often involve constrain attributes etc, which are performance taxing...

    Thanks once again and happy apping! :)

    EI8HTHSIN
Sign In or Register to comment.