0

" Player is running" not working

Aeon FitzGerald 2 months ago in Game Creator updated 1 month ago 8

Hey, 

I made a condition in which some actions would happen when the player is running, the condition only works when i use "player is idle" but nothing happens when i use "player is running" as if GC doesn't recognize when the player is running. 

I do have "player can run"  enabled.

Unity version:
2019.3
Game Creator version:
1.1.5
+1

You need to set a local or global bool when you switch to running, then in another trigger you use the action on variable changed. There you do something when true or stop when false.

+1

The trigger On variable changed is like update always looking for a variables state and updateing that every frame.

Tried this, same result which makes sense because i'm pretty sure  the character property "is running" is also a bool. 

I set up a global variable that gets set true when the characters property "is running"

I checked the variable during play and it was still false when running.

Then, i tried the bool with "is idle" and that actually made the bool true, it just doesn't work with running. 

  1. On your Player go into Basic parameters and switch off can run.
  2. Now make a trigger anywhere in your scene or on your player for example key down Left shift.
  3. In this trigger create an action and look for change property.
  4. In the drop down select Player and in property select can run.
  5. That’s it, now when playing your Player will run when you hold the left shift.
  6. If you want to check for player running, then add an action to this trigger bool variable and make a global or local bool called isRunning and activate this.
  7. Now make another Trigger somewhere in your scene and this trigger is on variable changed.
  8. Select your variable in this trigger and then add any conditions and actions your would like to happen when this variable is active as the player is now running.

I will make a short video later on this morning and post it here

Thanks for your response,


I knew of this option, but i wanted to avoid toggling run off and on in my game.

Im currently using the acceleration feature with a joystick, so running is relative to joystick sensitivity.


maybe its an issue with that? Otherwise i might have to settle with using a button to toggle running. 

I'll take a look at this tomorrow but I think you just need to watch the input float and activate your conditions when the float gets above or into the run region for example greater 0,5

Interesting, i'll look into that method. 


Where would that input float be located?