Jump to content

Cancel/stop current action


Recommended Posts

Hi, I need a function to stop/cancel the current action of the player (eg. perhaps the player has queued an action to pick a flower and I want the player to stop in their tracks for other UI purposes).

As a guess, perhaps there is something in the API like:

ThePlayer.actionQueue:Clear()

ThePlayer.controller:StopAction()

Something to that effect. Happy for hacky stuff like triggering some dummy function to 'walkto' a location 0.001m away etc to override the current action.

Link to comment
Share on other sites

If inst is your player, try these both together

inst.components.locomotor:Stop() -- stops any walking, including any associated with an action
inst:ClearBufferedAction() -- stops all actions, but it's best to call it after the above

 

Edited by TheSkylarr
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...