Question from a newbie - Moving Actors with Scripts
TouchTiltGames
Member Posts: 1,162
Often when I'm playing around with templates from the community, they're set for 480px but I want it set to 1024. So I set it to this resolution and move actors to where I want them to go (that have scripts on them) and they wont move or it stops working when I hit Preview. I'll look in the code and don't see where the x and y are specifically set. Take the elasticity demo from FireMapleGames, if I adjust the screen size and move the ball it won't move when I play it. All I see is Self.Position.X etc...
Just don't understand why you can't just move actors?
http://gamesalad.com/game/play/38647
Just don't understand why you can't just move actors?
http://gamesalad.com/game/play/38647
Comments
Where in GameSalad does one play with the x and y position of an Actor or where in the code? If I move an Actor around the stage from one of the templates, like Firemaple's Elastic demo, it won't go to where I move it to..just stays in same place.
Thanks.
There is no spoon.
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
It sounds like you are looking at the behaviors of the actors (when you say "scripts").
So you can take an actor prototype from the actor "palette" and drop it in the scene where it becomes an actor instance. In the actor instance, the X/Y position takes on the value of where the actor instance was placed in the scene.
You can also change the position with the "change attribute" or "constrain attribute" behaviors...they would contain "self.Position.X" or "self.Position.Y" in them. Also, the various other movement behaviors (e.g. "Move", "Move To", "Accelerate", "Accelerate To", "Change Velocity", etc.) will obviously affect their position too.
I will take a look at change attribute or constrain thanks!
Thanks for your help.