make an actor move to random direction every 1 sec?

POMPOM Member Posts: 2,599
edited November -1 in Working with GS (Mac)
hey im trying to make a scene with a frog that "jump" (move to) to random directions..
an its not going to well,
im having a progress when i do
every 1 sec
move to random X and random Y relative to scene

BUT i want that the head of the frog will allways point to the front so if it jump backward
the image will rotate to the direction of the movement

so it wont look like it goes in revers ;)
need your help guys

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Timer: Every 1 second:
    --Change Attribute: self.RandX = random(?,?)
    --Change Attribute: self.RandY = random(?,?)
    --Change Attribute: self.Rotation = vectorToAngle(self.RandX, self.RandY) + <some offset depending on which way your art is pointing>
    Move To: self.RandX , self.RandY
  • POMPOM Member Posts: 2,599
    hey codemonkey thank u for your help..
    but my actor is not rotating to the opposite direction when it goes backwards..
    i think it has something to do with the "some offset depending on which way your art is pointing"
    i dont understand what im suppose to put there, my actor pointing right for default ( ->)
    can you help me?!
Sign In or Register to comment.