How to connect local events (for touch movement) with state machine?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By anssiko

Hi,

I’m trying to wrap my head around the node-based state machine structure. I’m reverse engineering the “Finite state machine” demo and trying to define which direction to move the player in 2d with a local event for mobile touch input.

It seems that make_input_local is only available for use when extended to KinematicBody2d. Anywhere else in the tree it gives error “method not declared”.

(I have a usable version of player movement with all code in one file, but is is getting difficult to maintain with more states. Which is why I’m trying to split it to different files.)

Questions:

  • What are the limitations on applying “make_input_local”? The docs are unclear on this.
  • What would be the most simple node based state machine structure? A tutorial on this?
  • Where and how in state machine should I define local event touch controls?

I’ll add more detailed information in the comments.

          

You asked your question twice. You can hide it by clicking on the three dots in the bottom right of your question and selecting “Hide”.

njamster | 2020-03-06 15:29