Moving other actors on the scene
sneighbors
Member Posts: 5
This maybe a simple thing to do but I can't seem to find an answer or determine how to do it. What I would like to do is spawn a new actor (which I have done) and then from another actor (button) have that rotate the first actor 90 degrees. What I can't seem to determine is how to access a spawned actor in a scene like in js executing a getElementByID type of function. Is there a way to do this or do I need to find another way by using scene flags and reacting to that?
Comments
http://www.jamie-cross.net/?portfolio=gamesalad-simple-touch-controls
These controls move an actor around the screen but it would be simple to use the same concept to control an actors rotation.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
The way you do this is by using a global variable, e.g. game.firstActorRotation. In the button actor, you change or constrain the value of game.firstActorRotation and then in the spawned actor, you have a behavior (no rule) that constrains self.Rotation to game.firstActorRotation.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks again for the example.