How do i set an actor to not be movable when touching the player??
Jaytee
Member Posts: 79
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??
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
-
CodeMonkey Posts: 1,803Grumpy 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
if box overlaps with player
Change attribute self.physics.moveable to false
Otherwise
Change attribute self.physics.moveable to true