Need some serious constrain help! Happy Holidays Everybody!

I have a big block and constrained to it a smaller block- when dragging the big block- it drags with the smaller block(which is what I want), then when I press the small block it rotates it with the big block (which is what I want) but how can I have two big block actors in one scene, I did when I press one block I got the small block to go on that specific big block but when I click the smaller block it rotates both of them- how can I do it to only rotates one that is tapped on? I can send someone my work- please just help me!

Also happy holidays everybody!

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    The question is little confusing . . . . ! (apologies if English is not your first language).

    If you can make the question as clear as you can I am sure someone will be able to help you with the logic.
  • ChakkuChakku Member Posts: 1,513
    @MovingStudios

    Yep, I remember your issue from before. Both actors are constrained to the same attribute.

    Make another attribute and constrain that to your main attribute, and use that for your second big block; otherwise they're both attracted to the same attribute.

    It's pretty simple once you realize this
    Hope this helps, and that it works

    Chakku
  • TimeTime Member Posts: 113
    Hey I'm not really sure what you guys mean. Can I please send you guys the file and help me from there? @Chakku I don't really understand what you mean. =$.
  • TimeTime Member Posts: 113
    Can anyone else try to help? I'm really stuck.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    How are you rotating the big block actors? Are you constraining them to the rotation of the small actor by using a game attribute such as game.SmallActorRotation? Are you unlocking them and in the actor's instances constraining them to the small actor's self.rotation?

    One way to resolve this would be to check the distance (magnitude) of the game.mouse.position.X and Y from the big block actor and only run its rotation rules when the mouse is a less than a certain distance from it. That way, if you clicked/tapped in one area of the screen, the other big block actors that were farther away wouldn't rotate.

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

  • TimeTime Member Posts: 113
    I'm rotating the small block and I constrained the rotate so it rotates the big block as well. Check your pm @tatiang. Does anybody else have any answers?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2012
    There is a rule at the very bottom of the Mover1 (big actor) that constrains its rotation to game.Rotate1, which is also the rotation of the small actor. Just change it to this:

    image

    There's also a set of constrains just above that. Add this rule to them:

    image

    That works for one small actor as long as you don't drag outside of one big actor and into another.

    Whose template is that?

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

  • TimeTime Member Posts: 113
    Oh wow okay awesome it works! I made it and got stuck on that part. There's some fixing needed to be done but thank you! If I run into any more problems, I'll post here. Thanks guys!
Sign In or Register to comment.