i tried...isn't working...the actor remains in the same position
gyroscopeI am here.Member, Sous Chef, PROPosts: 6,598
edited October 2013
Hi @GLA, if you don't need to have "remembered" where a moving actor is teleporting FROM, then you've no worries about using Constrain Attribute behaviours anyway in this situation... (but if you had to use Constrain Attribute behaviours, I'm wondering why you'd want to avoid them...)
(btw, for the record - and I'm sounding picky but it might confuse some new users not familiar with programming so I'll mention - the Constrain Attributes are behaviours, not commands.)
Anyhow, simply use Change Attribute behaviours:
Rule: When scene.ReadyToTeleport01 is true Change Attribute self.Position.X to 480 Change Attribute self.Position.Y to 320
let me be more clearly...i have an actor outside the scene and when some atribute changes to true i want that actor to apear in the middle of the scene, and when is false to go back to the initial position outside the scene...but i don't want to use constrain atributes cause in that way they will be to much and will crash the game...so any solutions? right now i'm trying with spawning actor, and then destroy when that atribute is false
I think I use change attributes in my game when I wanted it to go on and off the screen depending on the value of a boolean. I used it for a reset/restart game button.
I don't see why constrain attributes would be too much and would crash your game. If it currently happens then you may have other problems.
gyroscopeI am here.Member, Sous Chef, PROPosts: 6,598
edited October 2013
So based on this new info, perhaps try my updated suggestion (using Change Attributes as @KevinCross suggested):
Rule: When scene.ReadyToTeleport01 is true Change Attribute self.Position.X to 480 Change Attribute self.Position.Y to 320 Otherwise Change Attribute self.Position.X to -60
Or if you still want to use a spawned actor, put in the spawned actor's Rules:
Change Attribute self.Position.X to 480 Change Attribute self.Position.Y to 320
Rule: When scene.ReadyToTeleport01 is false Destroy
Comments
Hi @GLA, if you don't need to have "remembered" where a moving actor is teleporting FROM, then you've no worries about using Constrain Attribute behaviours anyway in this situation... (but if you had to use Constrain Attribute behaviours, I'm wondering why you'd want to avoid them...)
(btw, for the record - and I'm sounding picky but it might confuse some new users not familiar with programming so I'll mention - the Constrain Attributes are behaviours, not commands.)
Anyhow, simply use Change Attribute behaviours:
Rule: When scene.ReadyToTeleport01 is true
Change Attribute self.Position.X to 480
Change Attribute self.Position.Y to 320
Edit: writing as @KevinCross was posting
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I don't see why constrain attributes would be too much and would crash your game. If it currently happens then you may have other problems.
So based on this new info, perhaps try my updated suggestion (using Change Attributes as @KevinCross suggested):
Rule: When scene.ReadyToTeleport01 is true
Change Attribute self.Position.X to 480
Change Attribute self.Position.Y to 320
Otherwise
Change Attribute self.Position.X to -60
Or if you still want to use a spawned actor, put in the spawned actor's Rules:
Change Attribute self.Position.X to 480
Change Attribute self.Position.Y to 320
Rule: When scene.ReadyToTeleport01 is false
Destroy
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
thanks for the sample too