Forum rules - please read before posting.

Inventory: Picking up items & Walk/Run toggle

edited May 2014 in Technical Q&A
Hello,

First issue is currently, i am trying to simply apply the root hand bones of my mesh into the Left/Right hand slots on the Mechanim Player script, but for some reason, when i apply them they are removed.

Any reason this may be happening or do they need tags/layers?

Second issue is, i cannot seem to find an action to toggle walking/running for the player. Such as pressing CAPS LOCK to toggle between the two. The only thing i can find is under Player--->Constrain--->Walk/Run--->Free, Always Run, Always Walk.

Is there a simply way to tie the toggle to an input?

-Thank you
«1

Comments

  • edited May 2014
    1) This tutorial, though outdated, does cover the process of assigning bone transforms to characters - that part at least should still be helpful for you.

    2) Not currently, but I'll look into it for the next release.  What's your Input Method set to - Direct?
  • As stated, i already drag and dropped the bones into the respected fields on the character. The issue, is that the bones that i drag and dropped,  are removed from the fields when i enter play or i apply the settings to the prefab.

    And yes, i am using direct mainly. I just assumed that toggling Walk/Run would be standard, my mistake. Is there a fix i can do in the meantime or an eta on the next release?

    -Thank you
  • I seem to have fixed the inventory issue by making the object a prefab again and deleting the previous version without bones assigned.

    The issue still stands with Toggling. Id also like to see a jump feature in the next patch perhaps.
  • Noted.  The bone issue has been fixed for the next update.  I'm hoping to get it out this week, but it may have to be next week instead - the more issues raised, the longer it takes!
  • edited November 2017
    Hi, sorry for necroing this, but I wasn't able to find a more recent relevant thread.

    Was the walk/run toggle feature implemented at the end?

    What I actually need is some way to enable/disable point&click running with a key like caps-lock, so when the player activates it, normal clicking on the scene sends double-clicks instead of single-clicks.

    I've tried to make a custom script to change walking speed when caps-lock is pressed, but that has the undesired effect of the character still running in cutscenes.

    Some easy way to achieve this with the current version?
  • ToggleRun is a valid input button, but only for Direct movement.

    If you are using Point And Click movement, then you need to create an Active Input that checks the state of a boolean Variable, toggles its value, and then uses the Player: Constrain Action to update the Walk/run field appropriately.

    Active Inputs are covered in Section 2.6 of the Manual.
  • Thanks for the reply, Chris.

    I wasn't too attentive to detail and missed that action altogether. However, I still have one issue.

    First of all, I must admit I didn't do the thing exactly as you said, because I've never tinkered with Unity Inputs before. What I've done is the following...:

    image

    It's PlayMaker FSM listening for CAPS-LOCK key downs. It works well to achieve the objective of calling those interactions, that in turn are like this:

    image   image

    Now, my problem is that I kind of expected that if "Walk / Run" was set to 'Always Run', the player would move to markers at run speed, not walking, which is what is happening.

    So now my players will love me for offering that Always Run toggle... but they'll hate me when they discover they still need to double-click on hotspots like "Door" or "Pathway to the peer", etc...

    Is there some way to change this behavior? The tricky part is that I still want the character walking to markers when a cutscene is running, but not when the player is still free to control the character.
  • Currently the "Always Run" refers to the behaviour when moving freely around the scene - not towards Markers as a result of clicking Hotspots.

    However, since setting it to "Always Walk" prevents double-clicking to run on Hotspots, I'd say this should behave as you expect - so I'll address this in the next update.
  • Hi Chris!

    Err... forgive me I didn't understand fully (English is not my main language).  :\">

    Just to make sure it's not wishful thinking on my part... you're saying you'll modify 'Walk to' and 'Walk to marker' player actions behaviors to 'Run to' and 'Run to marker' IF 'Always Run' is activated?

    That would be great! But I need to know it for sure before I go informing my patrons. 
    :P

    Thanks.
  • I won't be modifying the wording of the Hotspot Inspector, but effectively that's what'll happen, yes: if "Always Run" is set in the Player: Constrain Action, then single-clicking Hotspots will cause the player to run there.
  • I love you.  <:-P
  • I've noticed a weird (IMHO) behavior when using this Walk/Run toggle of mine...

    If the player character is in the middle of a 'Walk to marker' action and at that moment I press the key to activate 'Always Run', the Use interaction runs immediately without waiting for the player reaching the marker.

    That may be related to the fact that I've also noticed that when I activate the run/walk toggle the player stops, even when the action list is declared as 'Run in background':

    image

    Is there some way to make sure that if the player character stops moving while walking to a marker, the following use (or examine) action aborts?
  • If you use the Character: Move along path Action, have it affect the player and set the Method to Stop Moving, then it will also cancel the interaction if the player was on their way to a Hotspot.
  • Mmm, I don't quite understand. I'm not using 'Move along path' in hotspots. The only options I have are these:

    image

    To the best of my knowledge, the only difference between 'Walk to' and 'Walk to marker' is that the second one calculates pathfinding while the first one does not (walks in a straight line), so I'm using always 'Walk to marker' to be safe.

    But, as I've said, the thing that really bugs me is that in this particular case, if the previous post interaction (Player: Constrain -> Walk/Run = Always Run) is executed, the character stops walking AND it also starts the Use player action as if it had already reached the marker position.

    I think this behavior is not desirable in any circumstance that I can think of. Don't you agree?
  • Forget about the Hotspot options.  I was saying to try using the "Character: Move along path" Action in the same ActionList as your "Player: Constrain" Actions.

    Not to have the character move along a path, but to use it's "Stop moving" method - which will stop the player in his tracks when moving to a Hotspot.
  • Aaah okay, I didn't get you at first! ^_^

    Okay, it doesn't fire up the interaction now, which is good.

    However... could it be possible that Player Constrain: Walk/Run toggles didn't interrupt the move-to-marker action in the first place?

    I can imagine there must be a technical reason for that behavior, possibly related to some need of resetting / reconfiguring pathfinding (?). But knowing my players I'm sure they'll demand ask to know why the player stops when they toggle walk/run speed... and I must admit I'm also curious. :-\"

    In an ideal world, the character should continue moving towards the hotspot marker at a different speed, and still executing the Use, Examine, Talk, etc. interaction when reached.

    Tell me if I am trying to add a too much heavy burden on your already tired shoulders. ;)
  • edited December 2017
    It may be possible, movement method depending.  Are you using point-and-click?
  • Yeah, Point & Click.
  • All right, included in the latest, v1.60.5.  You should remove the stop moving call after changing the constrain option to keep the player moving.
  • edited December 2017
    Wow... that was FAST!  :))  Thank you!

    And now I finally have a reason to upgrade from 1.56...
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.