How do i set an actor to not be movable when touching the player??

Hello,

I need some help with this question: "How do i set an actor to not be movable when touching the player??"

I have some boxes that should be able to move around, but not be pushed by the player, when he walks into the boxes. And it's is not possible to toggle the "movable" on and off, while in the game. Is there any way to do this??

Best Answer

  • CodeMonkeyCodeMonkey Posts: 1,803
    edited April 2013 Accepted Answer
    Grumpy Monkey. No. Moveable is not changeable during gameplay.

    You'll need to get its current position, store in attributes, and constrain its position.
    Or stop all linear velocity modifying behaviors.

Answers

  • WingmanappsWingmanapps Member Posts: 458
    Sure it is - self.physics.moveable = false
  • WingmanappsWingmanapps Member Posts: 458
    in your case it would be like this

    if box overlaps with player
    Change attribute self.physics.moveable to false
    Otherwise
    Change attribute self.physics.moveable to true
  • WingmanappsWingmanapps Member Posts: 458
    :((
Sign In or Register to comment.