Forum rules - please read before posting.

Walking/Running speed multiplier to a scene

Hello everybody,
I thought I've read something about this long time ago, but cannot find it anymore (not in the forum, nor in the manual or in the action lists).
Basically I'd like a speed scale factor to be applied to all my characters on a scene.
Let me explain better: my game is 2.5D and I've some scenes where my characters are very small (remember old Monkey Island maps?). On those scenes I'd like both my two swappable players and other NPCs to walk/run faster than usual (all the other movements will stay the same but the walking speed, therefore both the walking anim loops and the walking distance, be way faster, but not Idle, Talking, etc.).
Is there something integrated into AC to achieve this?
Like a script to apply to the whole scene to change the movement speed factor?
(I know there's the scene time-factor, but I guess it's used for slow motion and anyway affect all the animations, not only the ones about movements in space).

Thanks a lot

Comments

  • A Sorting Map can be used to dynamically alter a character's speed, but this is currently tied to the character's size/scale as well. I'll see if these two properties can be made independent, so that only the speed can be controlled.

  • Yeah I used the SortingMap while ENCODYA was pure 2D, to move slower on vertical space when I had scenes with perspective. Didn't know I could apply it to a 3D space. And true, the speed was attached to scale when I was doing that in 2D...

    Thanks to dig into separating scale and speed!

  • Bringing up this thread again...
    So, the speed scale is now detached from size scale. And it's great.
    However, at least in my case, it's not related with animation speed, which, in my opinion, should change with the speed scale.
    I explain myself better: I've now my walk animation speed to 1. If I set my scene speed to 200%, my character move between two points in half of the time, but since the speed animation is still "1", then it "slides" on the ground. While if "scene speed = 200%" then the animation speed should also be 200%, therefore "2".
    Shouldn't it work like this? Maybe it's already like this but for some reasons not working on my end? (p.s. my walk animation is inside a Blend Tree called "Locomotion", which has 3 states: Idle-Walk-Run).
    Of course only the Walk/Run should be multiplied (not Idles or anything else), so maybe would be better to have the possibility to declare "public AnimationClip Walk" and "public AnimationClip Run" and drop them in the "Follow Sorting Map" script attached to the characters? And then multiply the animation clips speed following the one of the scene...
    Any ideas?

  • There's a disconnect between an animation clip, and the speed of the Blend Tree motion field that plays it.

    I'm not even sure that can be set through script. The closest I can find is this topic over on stackoverflow:

    https://stackoverflow.com/questions/42655657/api-to-set-the-speed-of-a-motion-using-a-mechanim-blend-tree

    If you do manage to set it through custom script, you can retrieve the character's Sorting Map speed multiplier with:

    GetComponent <FollowSortingMap>.GetLocalSpeed ();
    

    It may be more trouble than it's worth, though. If your map scenes always have the same fixed speed multiplier, I'd recommend creating a Transition to a separate Blend Tree that plays walk/run animations at a specific set speed.

  • Uhmmmm tricky business.
    The thing is: I'd like to use the speed multiplier factor only for a few scenes (the very big ones), so the player can reach hotspots and NPCs in a faster way...
    I'll dig script possibilities, as well as handle it in the animator, but that might require setting a new bool, like "SceneSize", if "big" go to that blend tree, if small to the other one... and maybe it's more time consuming (especially because the bigger scenes have also more way in/out, therefore I should change or the scenes nearby).

  • Your script could alternatively read the value of a "Scene attribute" that's used to determine the animation speed for each scene. That way, if it reads a value of e.g. -1 (which you'd set for all non-map scenes), you could have it revert back to normal speeds.

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.