How to reference an actor's changing attributes properly?
I have an actor(1) who's width is being interpolated to a greater size, and I want the scene to change when this actor collides with another actor(2), but ONLY when the first actor's width is a certain number. A rule is set up stating: When actor(1) collides with actor(2) and Actor(1)Width > 300, change scene. I have an attribute (ActorWidth) that is being constrained to the actor's width, and I used a display text to verify it is working properly, but when the actor reaches the specific width while colliding with the second actor, the scene doesn't change. Am I going about this the wrong way, or is this even possible in gamesalad?
Thanks.
Thanks.
Comments
Make and attribute and call it Actor1Width. Constrain that to the actors width. then when overlaps or collides with actor1 and Actor1Width=or > 300
Change Scene
You may try making the size not interpolate so big, like to 305 or something, and use a timer to constantly check for the width size. You would just add the timer behavior and have it say "every" 0.01 seconds - Then have your rule inside that timer that says when actor is greater than 300, change scene. That way once the interpolate is finished, the timer will keep telling it to check for the width, and should work then.
If you dont already change it to greater then or equal to
edit: just read threw all the posts in the thread, refer to tynans comment below. Theres problems with collide when interpolating
Has anybody actually been able to do something like this successfully?
Anyways, I think there might be a workaround for your problem if your actors are circles;
First here is a tutorial by T-shirt Booth for calculating distance between two actors;
Now using the distancefrom attribute you can make up a rule where you compare distancefrom to "sum of width of actor1 and actor2". While your actor expands, its width will too. When the sum of the widths of your actors (or sum of their radius) exceed or is equal to distancefrom; you can move to next sceene.
I hope that helps.