Entering&Exiting StateMachine : Entering the Targeting State

It appears that someone already posted a question about this, however the solution didn’t work for me as the enter and exit were both being immediately called when pressing the same key. How should one be able to enter and exit the targeting state with the same button without holding it down?

The target state is entered and exited using events. You don’t have to change anything except to listen to the right event.

In the course we set up 2 keys for the targeting state: one to target, and one to cancel targeting. We then listen for the targeting event in the freelook state, and we listen for the cancel event in the targeting state. All you need to do is also listen for the targeting event in the targeting state, instead of the cancel event. Then you can use the button to toggle between targeting and not.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms