I want to move my actor by a line of 45

Hello , i want to move my hero actor by a line oblique of 45, can anybody help me , thanks.

Comments

  • agueisagueis Member Posts: 420
    Can anyone help me?
  • SocksSocks London, UK.Member Posts: 12,822
    Would you like your hero actor to move at 45° (45 degrees) ?

    If so, then just do this:

    image
  • agueisagueis Member Posts: 420
    Hello, it,s ok but my hero actor has a gravity of 1200; direction 270, acceleration 1200
    and he can´t move in the direction of 45, thanks
  • InovaTechInovaTech Member Posts: 161
    use the move behavior. the use 45 as an angle
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It's a shame because he would have liked to move at 45°. So... what is it you're trying to do?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • agueisagueis Member Posts: 420
    Hello Tatiang, I would like that when my actor touch the image of an arrow will move in a direction of 45 degrees and move to a position following this angle of 45
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Okay, so you need a rule in your hero actor that says When actor collides with [arrow] actor, change self.Direction to 45. Replace the current gravity/accelerate value with self.Direction and change its initial value to 270. That way, the hero is always moving in the direction self.Direction... you just change its value when you want to point it another direction.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • agueisagueis Member Posts: 420
    How can I replace the gravity with self direction?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Are you using Scene gravity? If so, you need to turn it off and give each actor their own "gravity" using the accelerate behavior. You can replace the 1200 value you have with an attribute or you can put the accelerate behavior in an Otherwise section of a rule so that it gets disabled when a certain condition exists (e.g. you could set a boolean when the actor hits an arrow and only have the gravity enabled when the boolean is false).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Here's an example of what I mean.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • agueisagueis Member Posts: 420
    edited December 2013
    Hellow Tatiang ,I´m not using scene gravity, I have followed your example that works very well, I have done as well in my project, but I think that there is a problem with my initial gravity because is not directed to the second arrow as in your example, my character is jumping on the first arrow, greetings
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Make sure you have Relative To set to Scene and not to Actor in your Move behavior. If you want, post a screenshot of your rules and I can help more.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • agueisagueis Member Posts: 420
    On Inspector , scene attributes, the gravity x and y is 0.0 real
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    On Inspector , scene attributes, the gravity x and y is 0.0 real
    I was asking about the rules on your hero actor and your arrow actor. Do you have them set up the same way as in my demo?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • agueisagueis Member Posts: 420
    Hello, I have resolved by creating a interpolation: when the hero collides with the arrow 1 : interpolates toward the position of the arrow 2, when collides with the arrow 2 interpolates to the position of the arrow 3, thank you, greetings
Sign In or Register to comment.