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
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 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.
How can I replace the gravity with self direction?
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 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).
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 11,949
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
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 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.
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
Comments
If so, then just do this:
and he can´t move in the direction of 45, thanks