shooting help

sgtgutbuster

  • *
  • Posts: 10
i used this code from the random movement behavior to do a 4 way shooting kinda thing and i cant get it to work with my player actor :)
[SSSS]

coleislazy

  • *
  • Posts: 2607
The "direction of" block returns the facing in degrees. If you want to use it, you would use <[direction of [self]] = 0> to face right, then continue clockwise (90, 180, 270), I believe.

sgtgutbuster

  • *
  • Posts: 10
I'll try it thanks!
[SSSS]

sgtgutbuster

  • *
  • Posts: 10
it didn't work any other suggestions??
[SSSS]

Alexin

  • *
  • Posts: 3130
First, the block "direction of self" returns a Number, not Text. So you're basically comparing 23.7 with "up", for example. It makes no sense.

Second (considering you're comparing Numbers correctly), you're relying on an exact equality. Unless you're sure the direction of the actor is exactly 0.0 when facing right, then the last IF block won't execute.

Create a Text attribute named "Direction". Set it to "up" when the behavior that control the player's movement moves/rotates the player upward. Do the same for the other directions.
Now, from within the behavior above, fetch the attribute "Direction" and use it instead of "direction of self".
"Find the fun"
alexin@stencyl.com