Physic problem

tutysestutyses Member Posts: 134
edited January 2012 in Working with GS (Mac)
I have a drageable actor Just like tshirtbooth did on this video
The only difference is that the other objects in the scene are movable (in the tshirtbooth video they are not) and when the actor collide with them they go away.
I need them not to move when i m dragging the actor, they can only interact with the object after i release it
There are many drageable actor on the scene so i need something to make the objects not affected by collisions from the object i m dragging, and only from it , but at the same time it has to collide with it
any ideas?

Comments

  • tutysestutyses Member Posts: 134
    nobody? there is no way to costumize this?
  • battleduckbattleduck Member Posts: 105
    edited January 2012
    Hey off the top of my head, you could try this:

    Make a global boolean attribute called "Dragging" (or something similar)
    Then inside each actor that you can drag (pink one in the above video) around add a rule that says:
    When touch is pressed, change game.Dragging to true
    When touch is released, change game.Dragging to false

    This way you'll know when the actor is being dragged.

    Then in the other actors that you want to collide with (white ones in the above video)
    Add 2 real attributes called "PosX" & "PosY"
    Add Change Attribute self.PosX to self.position.x
    Add Change Attribute self.PosY to self.position.y
    This will register the X & Y of the actor as soon as it loads.

    Then add a rule that says: (still in the white actors)
    When game.Dragging = true
    Constrain Attribute self.position.x to self.PosX
    Constrain Attribute self.position.y to self.PosY

    This way when your drag the pink actor around, Draging = true, and therefore the white actors X & Y positions are constrained to the spot, i.e can't move.

    I hope this helps, I haven't had a chance to try it out, but give it a go.
    Oh, also, if you want to be able to drag the white actors around as well as have them stay still when dragging the pink into them, you may have to change
    the:
    Add Change Attribute self.PosX to self.position.x
    Add Change Attribute self.PosY to self.position.y
    to
    Add CONSTRAIN Attribute self.PosX to self.position.x
    Add CONSTRAIN Attribute self.PosY to self.position.y

    that way the PosX & PosY attributes you made are constantly updated to the actors current position.

    Cheers
    Battleduck
  • tutysestutyses Member Posts: 134
    Actuallly i have tried something pretty similar before, and didnt work but i ll check it again, it didnt constrain the position correctly maybe i did something wrong
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I would simply put the collide rule in the actor you are dragging. Find the rule that has the constrain stuff in it (I assume it is "when touch is pressed..."). Open up the otherwise section of this rule and put the collide behavior in their. Just be sure not to put a collide with draggable actor behavior in any of the other actors.
  • tutysestutyses Member Posts: 134
    Scitunes if i do that it will go through the objects while i m dragging it, i dont want it to do that but i dont want to affect the other objects physically while i m dragging it
  • tutysestutyses Member Posts: 134
    I will remake the question it would be how can i make the actor collide without affecting it physically when it collides ( i mean, if i push the actor with a certain actor i dont want it to move), but with the possibility of other actor that can collide with it and making him move
    i uploaded the gameproj
    http://www.mediafire.com/?mt6lyftlfmn53cy
  • tutysestutyses Member Posts: 134
    to make a real example, imagine i push the wall, it wont move, but my arms will actually collide with it, now imagine a bulldozer, it will collide with it and it will move the wall i have to make the same effect
Sign In or Register to comment.