want the actor to always face in the direction of travel.

DookiDooki Member Posts: 247
edited November -1 in Working with GS (Mac)
Hey all,

I have top down game with an actor moving to a spot in the scene and then turning around returning to the original starting point. He will be traveling like this in various areas in the scene. I've created an animation for walking, top view of course; but how do you create it so that the character is also facing forward on the return trip.

- Is there a way to physically have my actor move with normals facing forward at all times? This way no matter where he moves he will be facing in the direction he is traveling.
- Or is it easier to do it all in animation, where I create frames of my guy walking in both directions?

Much thanks!

Comments

  • chosenonestudioschosenonestudios Member Posts: 1,714
    Multiple multiple threads released on this... Use the search button at the top right hand corner... I actually might search with the title of your thread........
  • DookiDooki Member Posts: 247
    Thanks. I will.
  • DookiDooki Member Posts: 247
    OK, I've been looking through the forums but found nothing. My goal is to have my actor walk out to a target and return all the while facing forward.
    Picture three targets spread out across in a row. The actor walks out to the target and returns to his starting spot. He does this for all three targets. This also means that my animated walking actor travels at an angle as well. Thoughts?

    Thanks!
  • DookiDooki Member Posts: 247
    Hmmm, I have a feeling that I'm gonna need to make sprites for each direction and each angle. I don't think GS allows you a leading face or edge of a moving actor.
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    constrain self.rotation to

    vectorToAngle( self.Motion.Linear Velocity.X , self.Motion.Linear Velocity.Y )

    ...remember to not just cut and paste. You have to select everything from the dropdown menus.
    You probably know that but just in case.

    :)
  • DookiDooki Member Posts: 247
    Hey thanks!

    Currently that actor has a rule and two timers. Would the constrain attribute be separate or would I group it with one of the others?

    I tried it being a separate attribute but it plays the animation backwards.
  • DookiDooki Member Posts: 247
    I actually have the actor walking to the target, then pause, then return.
    With this constrain the actor animation is backwards, correct during the pause, then backwards on the return.
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    I have actors with all kinds of rules and i always keep this one seperate. The idea is that no matter it will always face forward.

    you'll just have to tinker with your initial direction direction

    It likely has something to do with 0º actually facing to the right or something.
  • DookiDooki Member Posts: 247
    Initial direction? Not sure where to adjust this. I have my actor placed in the scene. I have a "move to" command with X,Y from starting point. I do not have an attribute that has a 0º entry.

    Thanks.
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    Regardless of how you set the angle the constraint is just going to change it anywyas.

    You have to make sure your actual image is pointing the right way.

    Depending on the situation either straight up or to the right ninety degrees usually works.
Sign In or Register to comment.