Luyren's Mouse and Analog Aiming

Luyren

  • *
  • Posts: 2336
Today I was comissioned a behavior for 360 degrees aiming with analog controls, and it was agreed I could make the behavior publicly available. I also recorded the creation processes and commentated it afterwards, so now you can have a closer look into how I approach behavior making. Watch it here: https://youtu.be/nF8QFwDS-Ls

As for the behavior, it's attached to this post, and you need to be logged in to see it. It allows you to get the angle of an analog input, and it can automatically map gamepad buttons to four directional controls and face your actor towards that angle. You can also use it to make your actor face the mouse instead. The default values are set to the right analog stick, but there are debug options so you can quickly check the input codes for the left stick and set those as needed.

It also comes with a custom block, in which you input 4 direction controls, and it returns the angle of those controls, so you can get the angle for both analog sticks in your controller.

I'll not be creating an itch.io page just for this behavior because this whole endeavor inspired me to include analog options in all the behaviors from my upcoming AI and Combat pack, so that will handle both movement and aiming. For a standalone version, you can use this standalone behavior here.

Importing
  • Download and extract the file attached to this post.
  • Back-up your game by going to File > Export Game
  • Go to File > Import Resource, and select the Mouse and Analog Facing.png file.
  • Attach it to your desired actor, carefully read the description of the behavior and its attributes and have fun.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter