Reset a Actor Help

kajutokajuto Member Posts: 314
edited June 2012 in Miscellaneous
Hi there!!! i recently trying to reset a Actor but it won't stay put in his position, here what i did...Thanks in advance of course!

When Ball Actor collide with Wall Actor it trigger the 3rd Actor called: Move Actor

Move Actor
Rule#1:

Att. Game.TriggerCollide is true
Timer- after 1 second
Accelerate- direction 290.703 relative to: Scene and Acceleration: 75
Rotate- Direction: Clockwise and Speed: 25

Rule#2:
Att. Game.Reset (real att) is True
change att
- self. position.X to self.X
change att
-self. position.Y to self.Y
change att
-self.motion.linear.velocityX to 0
change att
-self.motion.linear.velocityY to 0
change att
-self.motion.angular.velocity to 0

Rule#3:
change att
-self.X to self.PositionX
change att
-self.Y to self.PositionY

Restart Actor:

Rule#1:

Touch is Pressed
change att
- game.Reset to True
-Reset Scene Behavior

Rule#2:
att game.Reset is True
- Timer after 1sec and Run to completion
- change att
- game.Reset to False

Every time i reset the scene all came back to his original position, except for the Move Actor, every time when he reset, he came back to his original position but KEEP accelerating to the destination X and Y values where i set him to go.

Answers

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @kajuto

    Personally I've never been able to find a way to successfully stop an Accelerate behaviour. Even with Drag added, the actor will still "twitch" a bit. I'd be interested to know how any other member has successfully done this...

    One solution would mean not having the accelerate aspect to the actor, just moving at a constant speed; if that's OK, then replace your Accelerate behaviour with self.Motion.Linear velocity.x (and y) adjusting the speed of both to get the required angle you want the actor to move in.

    Then to stop it, set self.Motion.Linear velocity.x and self.Motion.Linear velocity.y to 0 and it'll stop.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • kajutokajuto Member Posts: 314
    good morning Gyroscope!! long time no talk lol, i hope you're fine. Thanks in advance as i mention before.! I will try it now, and i let you know about it..
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    It probably won't stay put because somewhere you need to change trigger collide back to false.
  • kajutokajuto Member Posts: 314
    Thanks guys!! i did it after i change instead of Accelerate to Move Behavior and The Trigger Collider set back to False. But one little help i need, when it set back to his original position the Actor still in the rotation before i press Restart Button, how can i set it back to his original rotation ? example the monkey is standing up, but right now, he almost in 90 degree rotation
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Add a change attribute self.rotation to 0
  • kajutokajuto Member Posts: 314
    FryingBaconStudios thanks! i did it.! i appreciate it.! =-)
Sign In or Register to comment.