Constraint and it's actual function

wormilwormil Member Posts: 127
edited November -1 in Tech Support
http://gamesalad.com/forums/topic.php?id=32621
I posted there, but maybe I wasn't clear in what I was asking.

I want to know what exactly constraint is doing (code wise if possible). It seems to do something that either was not intended or makes no sense to me at all, this case would be....

1 (how I expect it t work) Game has attribute called X, actor is spawned and constrains actor.position.X to X. A second actor does the same. The displayed value of X will be what actor 2's X position is.

2 (how i don't expect and would like an explanation) Game has attribute called X, actor is spawned and constrains actor.position.X to X. Actor then spawns a second actor who constrains it's actor.positon.x to game.X + 25. A second actor does the same. The displayed value of X will be what actor 2's X position is however, the first spawned actor will be constrained to the first actor's X position + 25 and the second to the second actor's X positon + 25.

Why is this?

Comments

  • PhoticsPhotics Member Posts: 4,172
    If two actors are trying to constrain the same attribute, it will flicker... as they constantly overwrite each others data.

    If they're not trying to write to the same attribute, only read the data... then something might be wrong with the behaviors.

    If X is 25
    Actor A could be constrained to X
    and Actor B could be constrained to X+25

    That should work.
  • wormilwormil Member Posts: 127
    I will post a short demo of what I see so it makes more sense.

    The minimap demo takes advantage of this to implement the minimap. I'm not saying it's a problem really, I just want to understand what is happening so I can avoid any pitfalls and better utilize the gamesalad engine, if that makes sense.

    I called the demo 'constraints'.
Sign In or Register to comment.