Question from a newbie - Moving Actors with Scripts

TouchTiltGamesTouchTiltGames Member Posts: 1,162
edited November -1 in Working with GS (Mac)
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

Comments

  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Ok let me rephrase that as I think it sounded too confusing:

    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.
  • quantumsheepquantumsheep Member Posts: 8,188
    Look within the actor that doesn't want to move and check the code there.

    There is no spoon.

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • rebumprebump Member Posts: 1,058
    I think what QS is saying is you may be confusing the actor prototype with the actor instances that are actually in the scene.

    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.
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Yeah I am looking at the behaviors of the actors. The actor instance won't move to the spot I manually move it to after I hit Preview - it's still in the same spot. I'm only referring to this Elastic demo.

    I will take a look at change attribute or constrain thanks!

    Thanks for your help.
Sign In or Register to comment.