One actor stick firmly to another ???

onuferonufer Member Posts: 17
edited November -1 in Working with GS (Mac)
Hello everybody!!! For few days I am looking for resolving to my problem without any success.

Is it possible with GS to make two (or more) actors, to be stick firmly/inflexibly one to another. Of course I mean situation when they are moving ;-) I am playing with that problem, but can't find the answer. I am constraining/changing actors positions one according to another, but the best result I have, you can see on two movie examples below:





As you can see, one actor follows another, but with inertia, like they would be connected with elastic line. And I want actors to be connected like one body, firmly, and move with no inertia. Is it possible to gain such effect? And to do that in easy way?

Please help me someone if you can ;-)

Comments

  • ChobbifaceChobbiface PRO Posts: 491
    How are you constraining them? If you constrain attribute self.position X of actor 1 to self.position X of actor 2 and do the same for self.position Y of both actors then add '+60' on the end or some other number so they stack one above each other in the video and not completely over each other.
  • GruntGrunt Member Posts: 109
    Good some one has raised this issue. @chobbipod No this wont solve the problem.....I ll wait for the answer to this one because I was having trouble with my present project because of this exact reason! Actors follow but with a lag.
  • onuferonufer Member Posts: 17
    Thanks for answer ;-) And I am glad, that someone else has the same problem. I have idea for a game, and resolving to this problem is key issue for me.

    Maybe finally someone from "masters" here or just more experienced, will be interested to pay attention to this question... Is it possible? Or not?

    @ chobbipod: Of course I am constraining x and y position of other actor by adding value "plus or minus smthing (70)" - to place it where it should be realively to actor it is following ;-)
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    GameSalad can easily handle things like this. Constraining one actor's x.position to a different actor's x.position creates minimal lag. Same with change attribute.

    Perhaps there is something else going on that is making the actor lag a little. Got some other rules and/or behaviors that are causing the lag? Is there a timer and/or some looping mechanism that is updating too slowly?
  • POMPOM Member Posts: 2,599
    Well , i dont know how your actor moves in the game but if it constrains to the mouse/touch than simply instead of constraining the blue to the red , constrain it ALSO to the mouse/touch with the minus 70 and you should eliminate the lag..

    Roy.
  • onuferonufer Member Posts: 17
    Hmmm... @ P-O-M

    I will try this idea, and give answer as quick as possible if it brought any difference to that problem ;-) But anyway, that is smthing new to try ;-) Thanks
  • POMPOM Member Posts: 2,599
    onufer said:
    Hmmm... @ P-O-M

    I will try this idea, and give answer as quick as possible if it brought any difference to that problem ;-) But anyway, that is smthing new to try ;-) Thanks

    I checked it and there is no "flexibility" , both squares act as one body , so it should work unless your "red" actor moves in a different method like accelerating or something , then it complicate things a bit , (but still possible i have a solution if that's the case)

    BUT , if your "red" actor simply constrained to mouse or to touch , then constraining the blue to the same touch with an offset should work fine .

    Let me know ;)
    Roy.
  • onuferonufer Member Posts: 17
    Constraining to mouse/touch instead of constraining one actor to another, works fine. But problem is more complicated when you have more actors than one.

    I want to build horizontal strip made of such small blocks. I want this blocks to be draggable and movable (horizontaly), and sticked together like one body.

    First I was trying to gain such effect by "collide" behavior, but it doesn't work fine. Then I started to play with constraining. And here we are. Still don't know how to make it :-/
  • ChobbifaceChobbiface PRO Posts: 491
    @onufer. That's strange, do you mean like this..

    <iframe width="425" height="349" src="http://www.youtube.com/embed/F8if8Cl8So4?hl=en&fs=1" frameborder="0" allowfullscreen></iframe>

    I'm just constraining one actor to another, don't seem to have the lag. As RThurman said, perhaps there are other rules interfering
  • ChobbifaceChobbiface PRO Posts: 491
    oops link

    Sorry I should have recorded with 2 different colours for the actors, but I've tested I get no lag after changing the colours
  • onuferonufer Member Posts: 17
    Thats really strange ;-) Because this is effect I want to gain. And you say, that you are constraining one actor to another with such result? Hmmm...

    Lets summarise:

    - I have behavior to constrain actor (x,y) position to touch position when it is pressed and inside, otherwise: constrain actor position to another actor
    - Plus selfrotation = 0

    Thats all. I can't see what can make this "lag" effect

    @chobbipod: And you? What rules/behaviors you used?
  • ChobbifaceChobbiface PRO Posts: 491
    Do you have an email, I can send you the project file?
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @ onufer

    I just reproduced your rules/behavior and I don't get any noticeable lag/shearing/tearing.

    Are these the only rules/behavior(s) going on?

    Are there perhaps a bunch of constraints on other actors that are slowing the whole thing down?

    Does this happen only in this particular game. Have you tried to start over on a fresh game file? (Perhaps this particular file/game is corrupted somehow.)

    Is this a processor speed thing? (Are there too many app open and your machine is bogging down?)

    I'm just trying to brainstorm what could be causing this. Hope it helps.
  • onuferonufer Member Posts: 17
    I have made new project. Fresh one. And still have this lag effect :-/ I cut down behaviors to minimum. Really. But lag didn't disappear :-/

    @ RThurman: Do you think It can be coused by hardware restrictions? Processor speed? Or smthing else? I am working on Mac Mini. Only GS open and web browser. No other apps.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    onufer said:@ RThurman: Do you think It can be coused by hardware restrictions? Processor speed? Or smthing else? I am working on Mac Mini. Only GS open and web browser. No other apps.

    The Mac Mini should be OK. Does gamesalad lag with any other files/games that you create with computer? Are there other times when lag seems to happen? Is it only when using constrain behaviors? (If you answer no to these questions, then I don't think its a hardware issue.)

    Maybe a way to move forward is not to use constrains. Would you consider using 'change attribute' inside of a timer (set at .025 seconds).
Sign In or Register to comment.