Why does this even work?

RosalinaGalaxer

  • Posts: 239
Hey,

Not a super-important question; I just wanted to know why on earth the pre-shipped movement behaviors even work. I must be blind, because I can't see anything that would trigger the Move events. I'm confused...
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

Justin

  • *
  • Posts: 4716
The directional movement custom events are not needed for it to work.

It checks if the keys are pressed, and sets "Move X" and "Move Y" based on that.
Then it sets your speed based on "Move X" and "Move Y".
Then it sets your animation based on your speed.

All of that within the update event. But see how it checks "Use Controls" before looking at if the keys are pressed? That's only the normal flow for the behavior attached to an actor that responds to player input. What about an NPC? Since an NPC won't check for input, you can move it by instead calling the four directional movement events yourself.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

RosalinaGalaxer

  • Posts: 239
Huh. What number does a control default to, then?
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̓̇̾̎

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

Justin

  • *
  • Posts: 4716
If you mean the top two blocks, those are booleans being turned into numbers.

A control is either down or not (true or false).
True and false, when converted into numbers, become 1 and 0.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)