Direct Variable Access
Andre87
Member Posts: 42
Hey guys, Im new to GameSalad, and I came across a problem while experimenting.
Is there a ways to change an attribute of one actor directly through another actor. That is, is there a behavior
I can add to an actor that would change an attribute of another actor?
Is there a ways to change an attribute of one actor directly through another actor. That is, is there a behavior
I can add to an actor that would change an attribute of another actor?
Comments
Say you wanted actor 1 to control actors 2 color, for an example well use when you touch actor one, you want actor 2 to become invisible, then reapeear when you release.
So you would make a real attribute and call it actor2color, and then set it to 1 since thats its original state(alpha)
In actor 2 add a constrain attribute and constrain self color alpha to actor 2 color.
Then in actor one have when touch is pressed change attribute actor2color to 0.
That will then cause actor 2 to become invisible becaause its color is constrained to actor2color attribute that you made.
Then in actor one have another rule when touch is released change attribute actor2color to 0
So long story short since actors 2 color is constrained to the global attribute actor2color you made, you can now change its color threw any actor by simply having a change attribute behaviors and changing actor2color you made
"Also, an unlocked Instance can control another Actor - as well as everything in the Scene - directly"
So if there is a method for doing this, please tell me. I may be a beginner to GameSalad, but I am programmer. So I think I can handle it .
When you diuble click the actor thats actully dragged into the scene, and not the one you made in the actor pain, a screen will pop up with a lock. Thats staying its locked and that all it rules are controlled by whatever rules are in the original one in the actor pane. If you then click on the lock, it will unlock it and then youll see the are where you can add your rules and behaviors. Once its unlocked changes in the original actor in the actor pane wont effect the unlocked actor in the scene, and to change its rules u have to click onthe actual actor you unlocked in the scene and add them there.
Also like firemaple said when an actor is unlocked, and you add a change or constrain attribute behavior in the unlocked actor, and then go into the attribute browser youll see a extra list in the drop down that says current scene (you only scene that in unlocked actors) You can then get to every actor in the scenes attributes,(so the position, color, ect of every actor in the scene) as well as scene attributes which include camera position and rotation.
But say you control one actor, or the camera or somethign like that threw a unlocked actor, and happen to forgot which one you did that too and then want to delete the behavior, youll have to check every actor in the scene of that type till you find the right one. Theres also some other issues you can run into.
Riiiiiiiight. Got it man. Thank you soooo much .